rez_core 4.0.38 → 4.0.39

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "4.0.38",
3
+ "version": "4.0.39",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -261,33 +261,37 @@ export class FilterService {
261
261
 
262
262
  // check level_id and level_type
263
263
  // ✅ Special condition for TEMPLATE entity
264
- if (entity_type === 'TEM') {
264
+ // Special condition for TEMPLATE entity
265
+ if (entity_type === 'TEMP' || entity_type === 'TEM') {
266
+ const templateTable = entityMeta?.data_source || 'frm_comm_template'; // fallback
267
+
265
268
  if (level_type === 'ORG') {
266
- // ORG level → no extra filter
269
+ // ORG level → no filter
267
270
  } else if (level_type === 'SCH') {
268
271
  baseWhere.push({
269
272
  query: `
270
273
  (
271
- (e.level_type = 'SCH' AND e.level_id = :school_id)
274
+ (e.level_type = 'SCH' AND e.level_id = :sch_level_id)
272
275
  OR
273
276
  (
274
- e.level_type = 'ORG'
275
- AND e.level_id = :org_id
277
+ e.level_type = 'ORG'
278
+ AND e.level_id = :org_level_id
276
279
  AND e.template_code NOT IN (
277
- SELECT template_code
278
- FROM frm_wf_comm_template
279
- WHERE level_type = 'SCH' AND level_id = :school_id
280
+ SELECT sub.template_code
281
+ FROM ${templateTable} AS sub
282
+ WHERE sub.level_type = 'SCH' AND sub.level_id = :sch_level_id
280
283
  )
281
284
  )
282
285
  )
283
286
  `,
284
287
  params: {
285
- school_id: level_id,
286
- org_id: organization_id,
288
+ sch_level_id: level_id,
289
+ org_level_id: organization_id,
287
290
  },
288
291
  });
289
292
  }
290
- }
293
+ }
294
+
291
295
 
292
296
  if (
293
297
  entity_type != 'ORGP' &&