rez_core 5.0.26 → 5.0.27

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": "5.0.26",
3
+ "version": "5.0.27",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -36,11 +36,15 @@ export class ListMasterItemsRepository {
36
36
  status: 'ACTIVE',
37
37
  };
38
38
 
39
+ // Helper to check numeric
40
+ const isNumeric = (value: any) => !isNaN(Number(value));
41
+
39
42
  // Sorting logic
40
- if (sort_by) {
43
+ if (sort_by && isNumeric(sort_by)) {
41
44
  const listMasterItem = await this.repo.findOne({
42
- where: { id: sort_by },
45
+ where: { id: Number(sort_by) },
43
46
  });
47
+
44
48
  const sortValue = listMasterItem?.value?.toLowerCase();
45
49
 
46
50
  if (sortValue) {
@@ -59,9 +63,9 @@ export class ListMasterItemsRepository {
59
63
  }
60
64
 
61
65
  // Handle parent_code logic
62
- if (params?.parent) {
66
+ if (params?.parent && isNumeric(params.parent)) {
63
67
  const parentItem = await this.repo.findOne({
64
- where: { id: parseInt(params.parent) },
68
+ where: { id: Number(params.parent) },
65
69
  });
66
70
 
67
71
  if (parentItem?.code) {