sr-npm 1.7.502 → 1.7.504
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/data.js +5 -4
- package/backend/secretsData.js +1 -1
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -38,11 +38,12 @@ async function filterBasedOnBrand(positions) {
|
|
|
38
38
|
return brand === desiredBrand;
|
|
39
39
|
});
|
|
40
40
|
} catch (error) {
|
|
41
|
-
if(error.message
|
|
42
|
-
|
|
41
|
+
if(error.message==="[getTokenFromCMS], No desiredBrand found")
|
|
42
|
+
{
|
|
43
|
+
console.warn(error.message)
|
|
44
|
+
return positions.content;
|
|
43
45
|
}
|
|
44
|
-
|
|
45
|
-
return positions.content;
|
|
46
|
+
throw error;
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
package/backend/secretsData.js
CHANGED
|
@@ -22,7 +22,7 @@ const getSecretValue = auth.elevate(secrets.getSecretValue);
|
|
|
22
22
|
async function getTokenFromCMS(tokenName) {
|
|
23
23
|
const result = await wixData.query(COLLECTIONS.SECRET_MANAGER_MIRROR).eq('tokenName',tokenName).find();
|
|
24
24
|
if (result.items.length > 0) {
|
|
25
|
-
return result.items[0].
|
|
25
|
+
return result.items[0].value;
|
|
26
26
|
} else {
|
|
27
27
|
throw new Error(`[getTokenFromCMS], No ${tokenName} found`);
|
|
28
28
|
}
|