rez_core 2.1.35 → 2.1.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
|
@@ -166,20 +166,28 @@ export class ModuleAccessRepository {
|
|
|
166
166
|
const allActions = await this.moduleActionRepo.find({
|
|
167
167
|
where: { module_code: In(moduleCodes) },
|
|
168
168
|
});
|
|
169
|
-
|
|
170
|
-
// Map actions by module_code with
|
|
169
|
+
|
|
170
|
+
// Map actions by module_code with VIEW action first
|
|
171
171
|
const actionMap = allActions.reduce(
|
|
172
172
|
(acc, action) => {
|
|
173
173
|
if (!acc[action.module_code]) acc[action.module_code] = [];
|
|
174
|
-
|
|
174
|
+
|
|
175
|
+
const actionItem = {
|
|
175
176
|
action: action.action_type,
|
|
176
177
|
name: action.action_name,
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
if (action.action_type === 'VIEW') {
|
|
181
|
+
acc[action.module_code].unshift(actionItem); // ➕ Add VIEW at start
|
|
182
|
+
} else {
|
|
183
|
+
acc[action.module_code].push(actionItem); // ➕ Add others at end
|
|
184
|
+
}
|
|
185
|
+
|
|
179
186
|
return acc;
|
|
180
187
|
},
|
|
181
188
|
{} as Record<string, { action: string; name: string }[]>,
|
|
182
189
|
);
|
|
190
|
+
|
|
183
191
|
|
|
184
192
|
const levelsToReturn = levelType === 'ORG' ? ['ORG', 'SCH'] : ['SCH'];
|
|
185
193
|
|