sumba 2.11.0 → 2.11.1
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.
|
@@ -34,11 +34,6 @@ export async function rebuildFilter (modelName, filter, req) {
|
|
|
34
34
|
if (filter.query.$and) q.$and.push(...filter.query.$and)
|
|
35
35
|
else q.$and.push(filter.query)
|
|
36
36
|
}
|
|
37
|
-
/*
|
|
38
|
-
if (!(hasSiteId || hasUserId || hasTeamId)) {
|
|
39
|
-
return filter
|
|
40
|
-
}
|
|
41
|
-
*/
|
|
42
37
|
if (hasSiteId) q.$and.push({ siteId: req.site.id })
|
|
43
38
|
if (hasTeamId && !isAdmin) {
|
|
44
39
|
const teamIds = map(req.user.teams, 'id')
|
package/lib/util.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
export function parseNsSettings (ns, setting, items) {
|
|
2
|
-
const { trim, set, isPlainObject, isArray, isEmpty } = this.app.lib._
|
|
2
|
+
const { trim, set, isPlainObject, isArray, isEmpty, find } = this.app.lib._
|
|
3
3
|
const { parseObject, dayjs } = this.app.lib
|
|
4
4
|
|
|
5
5
|
for (const item of items) {
|
|
6
|
+
if (item.ns === '_var' || ns === '_var') continue
|
|
6
7
|
let value = trim([item.value] ?? '')
|
|
7
|
-
if (['
|
|
8
|
+
if (value[0] === '#' && value[value.length - 1] === '#') {
|
|
9
|
+
const val = value.slice(1, -1)
|
|
10
|
+
const newValue = find(items, { ns: '_var', key: val })
|
|
11
|
+
if (newValue) value = newValue.value
|
|
12
|
+
}
|
|
13
|
+
if (['[', '{'].includes(value[0]) && [']', '}'].includes(value[value.length - 1])) {
|
|
8
14
|
try {
|
|
9
15
|
value = parseObject(JSON.parse(value))
|
|
10
16
|
} catch (err) {}
|
package/package.json
CHANGED