rez_core 4.0.35 → 4.0.37
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/package.json
CHANGED
|
@@ -260,20 +260,48 @@ export class FilterService {
|
|
|
260
260
|
const baseWhere = this.buildWhereClauses(baseFilters, attributeMetaMap);
|
|
261
261
|
|
|
262
262
|
// check level_id and level_type
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
263
|
+
// ✅ Special condition for TEMPLATE entity
|
|
264
|
+
if (entity_type === 'TEM') {
|
|
265
|
+
if (level_type === 'ORG') {
|
|
266
|
+
// ORG level → no extra filter
|
|
267
|
+
} else if (level_type === 'SCH') {
|
|
268
|
+
baseWhere.push({
|
|
269
|
+
query: `
|
|
270
|
+
(
|
|
271
|
+
(e.level_type = 'SCH' AND e.level_id = :school_id)
|
|
272
|
+
OR
|
|
273
|
+
(
|
|
274
|
+
e.level_type = 'ORG'
|
|
275
|
+
AND e.level_id = :org_id
|
|
276
|
+
AND e.template_code NOT IN (
|
|
277
|
+
SELECT template_code
|
|
278
|
+
FROM frm_comm_template
|
|
279
|
+
WHERE level_type = 'SCH' AND level_id = :school_id
|
|
280
|
+
)
|
|
281
|
+
)
|
|
282
|
+
)
|
|
283
|
+
`,
|
|
284
|
+
params: {
|
|
285
|
+
school_id: level_id,
|
|
286
|
+
org_id: organization_id,
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
} else if (
|
|
291
|
+
entity_type != 'ORGP' &&
|
|
292
|
+
level_type &&
|
|
293
|
+
level_id &&
|
|
294
|
+
organization_id &&
|
|
295
|
+
!customLevelType &&
|
|
296
|
+
!customLevelId
|
|
297
|
+
) {
|
|
298
|
+
baseWhere.push({
|
|
299
|
+
query:
|
|
300
|
+
'e.organization_id = :organization_id AND e.level_type = :level_type AND e.level_id = :level_id',
|
|
301
|
+
params: { organization_id, level_type, level_id },
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
|
|
277
305
|
|
|
278
306
|
if (entity_type == "USR" || entity_type == "UPR") {
|
|
279
307
|
baseWhere.push({
|