rez_core 4.0.166 → 4.0.167
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
|
@@ -290,23 +290,23 @@ export class FilterService {
|
|
|
290
290
|
|
|
291
291
|
if (level_type === 'ORG') {
|
|
292
292
|
baseWhere.push({
|
|
293
|
-
query: ` ((e.level_type = 'ORG' AND e.level_id = ${loggedInUser.organization_id} AND e.organization_id = ${loggedInUser.organization_id}))`,
|
|
293
|
+
query: ` ((e.level_type = 'ORG' AND e.level_id = '${loggedInUser.organization_id}' AND e.organization_id = '${loggedInUser.organization_id}'))`,
|
|
294
294
|
params: {},
|
|
295
295
|
});
|
|
296
296
|
} else if (level_type === 'SCH') {
|
|
297
297
|
baseWhere.push({
|
|
298
298
|
query: `
|
|
299
299
|
(
|
|
300
|
-
(e.level_type = 'SCH' AND e.level_id = ${loggedInUser.level_id} AND e.organization_id = ${loggedInUser.organization_id})
|
|
300
|
+
(e.level_type = 'SCH' AND e.level_id = '${loggedInUser.level_id}' AND e.organization_id = '${loggedInUser.organization_id}')
|
|
301
301
|
OR
|
|
302
302
|
(
|
|
303
303
|
e.level_type = 'ORG'
|
|
304
|
-
AND e.level_id = ${loggedInUser.organization_id}
|
|
305
|
-
AND e.organization_id = ${loggedInUser.organization_id}
|
|
304
|
+
AND e.level_id = '${loggedInUser.organization_id}'
|
|
305
|
+
AND e.organization_id = '${loggedInUser.organization_id}'
|
|
306
306
|
AND e.code NOT IN (
|
|
307
307
|
SELECT sub.code
|
|
308
308
|
FROM frm_wf_comm_template AS sub
|
|
309
|
-
WHERE sub.level_type = 'SCH' AND sub.level_id = ${loggedInUser.level_id}
|
|
309
|
+
WHERE sub.level_type = 'SCH' AND sub.level_id = '${loggedInUser.level_id}'
|
|
310
310
|
)
|
|
311
311
|
)
|
|
312
312
|
)
|
|
@@ -330,7 +330,7 @@ export class FilterService {
|
|
|
330
330
|
baseWhere.push({
|
|
331
331
|
query:
|
|
332
332
|
'e.organization_id = :organization_id AND e.level_type = :level_type AND e.level_id = :level_id',
|
|
333
|
-
params: { organization_id, level_type, level_id },
|
|
333
|
+
params: { organization_id : String(organization_id), level_type, level_id },
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
336
|
|
|
@@ -346,9 +346,9 @@ export class FilterService {
|
|
|
346
346
|
query:
|
|
347
347
|
'e.organization_id = :organization_id AND e.level_type = :customLevelType AND e.level_id = :customLevelId AND e.appcode = :customAppCode',
|
|
348
348
|
params: {
|
|
349
|
-
organization_id,
|
|
349
|
+
organization_id: String(organization_id),
|
|
350
350
|
customLevelType,
|
|
351
|
-
customLevelId,
|
|
351
|
+
customLevelId: String(customLevelId),
|
|
352
352
|
customAppCode,
|
|
353
353
|
},
|
|
354
354
|
});
|
|
@@ -764,9 +764,23 @@ export class FilterService {
|
|
|
764
764
|
attributeMeta: Record<string, any>,
|
|
765
765
|
) {
|
|
766
766
|
return filters
|
|
767
|
-
.map((f) =>
|
|
767
|
+
.map((f) => {
|
|
768
|
+
const clause = this.buildCondition(f, attributeMeta[f.filter_attribute]);
|
|
769
|
+
|
|
770
|
+
if (!clause) return null;
|
|
771
|
+
|
|
772
|
+
// Force every param to be a string
|
|
773
|
+
if (clause.params) {
|
|
774
|
+
Object.keys(clause.params).forEach((k) => {
|
|
775
|
+
clause.params[k] = String(clause.params[k]);
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
return clause;
|
|
780
|
+
})
|
|
768
781
|
.filter(
|
|
769
|
-
(clause): clause is { query: string; params:
|
|
782
|
+
(clause): clause is { query: string; params: Record<string, string> } =>
|
|
783
|
+
clause !== null,
|
|
770
784
|
);
|
|
771
785
|
}
|
|
772
786
|
|