@arcteryx/js-cms
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -6,2 +6,13 @@ # Change Log | ||
## [2.0.1](https://bitbucket.org/arcteryx/arcteryx-js-helpers/compare/@arcteryx/js-cms@2.0.0...@arcteryx/js-cms@2.0.1) (2021-08-09) | ||
### Bug Fixes | ||
* (getCsPhoneNumber) Prefix url with https for the cmsUrl and check for data if null ([117b454](https://bitbucket.org/arcteryx/arcteryx-js-helpers/commits/117b454e8763e412eb2969fa5f12d2145903f10f)) | ||
# [2.0.0](https://bitbucket.org/arcteryx/arcteryx-js-helpers/compare/@arcteryx/js-cms@1.27.20...@arcteryx/js-cms@2.0.0) (2021-04-28) | ||
@@ -8,0 +19,0 @@ |
@@ -215,5 +215,5 @@ 'use strict'; | ||
async function getCsPhoneNumber(cmsUrl, market, country) { | ||
const drupalUrl = `//${cmsUrl}/jsonapi/node/cs_phone_number/?filter%5Bfield_market%5D=${market}&filter%5Bfield_allowed_countries%5D=${country}&fields%5Bnode--cs_phone_number%5D=title`; | ||
const drupalUrl = `https://${cmsUrl}/jsonapi/node/cs_phone_number/?filter%5Bfield_market%5D=${market}&filter%5Bfield_allowed_countries%5D=${country}&fields%5Bnode--cs_phone_number%5D=title`; | ||
const data = await GetDrupalData(drupalUrl); | ||
return data.length ? data[0].title : null; | ||
return data !== null && data !== void 0 && data.length ? data[0].title : null; | ||
} | ||
@@ -220,0 +220,0 @@ /* |
@@ -211,5 +211,5 @@ /** | ||
async function getCsPhoneNumber(cmsUrl, market, country) { | ||
const drupalUrl = `//${cmsUrl}/jsonapi/node/cs_phone_number/?filter%5Bfield_market%5D=${market}&filter%5Bfield_allowed_countries%5D=${country}&fields%5Bnode--cs_phone_number%5D=title`; | ||
const drupalUrl = `https://${cmsUrl}/jsonapi/node/cs_phone_number/?filter%5Bfield_market%5D=${market}&filter%5Bfield_allowed_countries%5D=${country}&fields%5Bnode--cs_phone_number%5D=title`; | ||
const data = await GetDrupalData(drupalUrl); | ||
return data.length ? data[0].title : null; | ||
return data !== null && data !== void 0 && data.length ? data[0].title : null; | ||
} | ||
@@ -216,0 +216,0 @@ /* |
@@ -222,5 +222,5 @@ (function (global, factory) { | ||
async function getCsPhoneNumber(cmsUrl, market, country) { | ||
const drupalUrl = `//${cmsUrl}/jsonapi/node/cs_phone_number/?filter%5Bfield_market%5D=${market}&filter%5Bfield_allowed_countries%5D=${country}&fields%5Bnode--cs_phone_number%5D=title`; | ||
const drupalUrl = `https://${cmsUrl}/jsonapi/node/cs_phone_number/?filter%5Bfield_market%5D=${market}&filter%5Bfield_allowed_countries%5D=${country}&fields%5Bnode--cs_phone_number%5D=title`; | ||
const data = await GetDrupalData(drupalUrl); | ||
return data.length ? data[0].title : null; | ||
return data !== null && data !== void 0 && data.length ? data[0].title : null; | ||
} | ||
@@ -227,0 +227,0 @@ /* |
{ | ||
"name": "@arcteryx/js-cms", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"source": "src/index.js", | ||
@@ -32,3 +32,3 @@ "main": "dist/cjs/index.js", | ||
"license": "ISC", | ||
"gitHead": "fa786f3a7393d5e4814cf840f2da037d85b7c4a0", | ||
"gitHead": "09ee5f71e2466e8590366487dd32493c75fd8167", | ||
"files": [ | ||
@@ -35,0 +35,0 @@ "dist", |
@@ -195,5 +195,5 @@ import { toQueryParams } from "@arcteryx/js-url"; | ||
export async function getCsPhoneNumber(cmsUrl, market, country) { | ||
const drupalUrl = `//${cmsUrl}/jsonapi/node/cs_phone_number/?filter%5Bfield_market%5D=${market}&filter%5Bfield_allowed_countries%5D=${country}&fields%5Bnode--cs_phone_number%5D=title`; | ||
const drupalUrl = `https://${cmsUrl}/jsonapi/node/cs_phone_number/?filter%5Bfield_market%5D=${market}&filter%5Bfield_allowed_countries%5D=${country}&fields%5Bnode--cs_phone_number%5D=title`; | ||
const data = await GetDrupalData(drupalUrl); | ||
return data.length ? data[0].title : null; | ||
return data?.length ? data[0].title : null; | ||
} | ||
@@ -324,11 +324,3 @@ | ||
*/ | ||
export const getCategoryIntro = async ( | ||
cmsUrl, | ||
basicAuthToken, | ||
market, | ||
country, | ||
language, | ||
path, | ||
previewDraft | ||
) => { | ||
export const getCategoryIntro = async (cmsUrl, basicAuthToken, market, country, language, path, previewDraft) => { | ||
const fetchOptions = previewDraft | ||
@@ -335,0 +327,0 @@ ? { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
160074
1303
9