rez_core 5.0.206 → 5.0.207
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/dist/module/workflow-automation/service/workflow-automation.service.js +8 -6
- package/dist/module/workflow-automation/service/workflow-automation.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/workflow-automation/service/workflow-automation.service.ts +9 -9
package/package.json
CHANGED
|
@@ -175,27 +175,27 @@ export class WorkflowAutomationService extends EntityServiceImpl {
|
|
|
175
175
|
where: { workflow_automation_id: workflow.id },
|
|
176
176
|
});
|
|
177
177
|
|
|
178
|
-
const existingMap = new Map(
|
|
179
|
-
existingActions.map((a) => [a.action_category_id, a]),
|
|
180
|
-
);
|
|
178
|
+
const existingMap = new Map(existingActions.map((a) => [a.name, a]));
|
|
181
179
|
|
|
182
180
|
// 2. Upsert actions
|
|
183
181
|
for (const a of action) {
|
|
184
|
-
if (!a?.
|
|
182
|
+
if (!a?.name) {
|
|
185
183
|
this.logger.warn(
|
|
186
|
-
`Skipping action without
|
|
184
|
+
`Skipping action without unique name: ${JSON.stringify(a)}`,
|
|
187
185
|
);
|
|
188
186
|
continue;
|
|
189
187
|
}
|
|
190
188
|
|
|
191
|
-
const existing = existingMap.get(a.
|
|
189
|
+
const existing = existingMap.get(a.name);
|
|
192
190
|
|
|
193
191
|
if (existing) {
|
|
194
192
|
// update
|
|
195
193
|
existing.payload = a.actionPayload ?? {};
|
|
196
194
|
existing.actioncategoryname =
|
|
197
195
|
a.actionCategoryName ?? existing.actioncategoryname;
|
|
198
|
-
|
|
196
|
+
existing.status = a.status ?? existing.status;
|
|
197
|
+
existing.action_category_id =
|
|
198
|
+
a.actionCategory ?? existing.action_category_id;
|
|
199
199
|
await this.dataSource
|
|
200
200
|
.getRepository(WorkflowAutomationActionEntity)
|
|
201
201
|
.save(existing);
|
|
@@ -217,9 +217,9 @@ export class WorkflowAutomationService extends EntityServiceImpl {
|
|
|
217
217
|
this.logger.log(`Created new action: ${a.actionCategory}`);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
const
|
|
220
|
+
const incomingNames = action.map((a) => a.name);
|
|
221
221
|
const toDelete = existingActions.filter(
|
|
222
|
-
(a) => !
|
|
222
|
+
(a) => !incomingNames.includes(a.name),
|
|
223
223
|
);
|
|
224
224
|
|
|
225
225
|
if (toDelete.length) {
|