corebasic 1.0.118 → 1.0.120
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/libs/features.js +2 -2
- package/libs/privileges.js +2 -0
- package/package.json +1 -1
package/libs/features.js
CHANGED
|
@@ -20,7 +20,7 @@ async function loadLocalFeatures() { // For Local Testing
|
|
|
20
20
|
if (process.env.LOAD_LOCAL_FEATURES) {
|
|
21
21
|
try {
|
|
22
22
|
let url = 'https://slyp.app/slyp-dev/api/v1/features'
|
|
23
|
-
let result = (await axios.get(url, { data: {}, headers: {jwt: SERVICE_ACCESS_TOKEN, service: true}, timeout:
|
|
23
|
+
let result = (await axios.get(url, { data: {}, headers: {jwt: SERVICE_ACCESS_TOKEN, service: true}, timeout: 3000 })).data
|
|
24
24
|
await Utils.stringToFile('/slyp.local.features.json', JSON.stringify(result.data, null, '\t'))
|
|
25
25
|
} catch {
|
|
26
26
|
console.log('Error Fetching Remote Features')
|
|
@@ -66,7 +66,7 @@ export const send = async (meta, feature, data, params) => {
|
|
|
66
66
|
url: `${service}${url}`,
|
|
67
67
|
headers: { jwt: SERVICE_ACCESS_TOKEN, service: true },
|
|
68
68
|
data: payload,
|
|
69
|
-
timeout:
|
|
69
|
+
timeout: 3000
|
|
70
70
|
})).data;
|
|
71
71
|
}
|
|
72
72
|
|
package/libs/privileges.js
CHANGED
|
@@ -77,6 +77,8 @@ const check = async (company, user, feature, req) => {
|
|
|
77
77
|
export const checkRequest = async (req) => {
|
|
78
78
|
let meta = {...req.body, data: undefined}
|
|
79
79
|
req.meta = meta
|
|
80
|
+
if (req.body.feature === 'outlets.query.list') // Starting point for atleast selecting an outlet. (This is a Special Case)
|
|
81
|
+
return true
|
|
80
82
|
return await check(req.body.company, req.body.user, req.body.feature, req)
|
|
81
83
|
}
|
|
82
84
|
|