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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "5.0.206",
3
+ "version": "5.0.207",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -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?.actionCategory) {
182
+ if (!a?.name) {
185
183
  this.logger.warn(
186
- `Skipping action without category: ${JSON.stringify(a)}`,
184
+ `Skipping action without unique name: ${JSON.stringify(a)}`,
187
185
  );
188
186
  continue;
189
187
  }
190
188
 
191
- const existing = existingMap.get(a.actionCategory);
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
- existing.status = a.status ?? existing.status;
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 incomingCategories = action.map((a) => a.actionCategory);
220
+ const incomingNames = action.map((a) => a.name);
221
221
  const toDelete = existingActions.filter(
222
- (a) => !incomingCategories.includes(a.action_category_id),
222
+ (a) => !incomingNames.includes(a.name),
223
223
  );
224
224
 
225
225
  if (toDelete.length) {