@adminforth/bulk-ai-flow 1.14.2 → 1.14.3
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/build.log +1 -1
- package/dist/index.js +8 -27
- package/index.ts +11 -30
- package/package.json +1 -1
package/build.log
CHANGED
package/dist/index.js
CHANGED
|
@@ -599,33 +599,14 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
const reorderedOldRecord = Object.keys(fieldsToUpdate[idx]).reduce((acc, key) => {
|
|
611
|
-
if (key in oldRecord) {
|
|
612
|
-
acc[key] = oldRecord[key];
|
|
613
|
-
}
|
|
614
|
-
return acc;
|
|
615
|
-
}, {});
|
|
616
|
-
AuditLogPlugin.logCustomAction({
|
|
617
|
-
resourceId: this.resourceConfig.resourceId,
|
|
618
|
-
recordId: ID,
|
|
619
|
-
actionId: 'Bulk-ai-flow',
|
|
620
|
-
oldData: reorderedOldRecord,
|
|
621
|
-
data: fieldsToUpdate[idx],
|
|
622
|
-
user: adminUser,
|
|
623
|
-
headers: headers
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
catch (error) { }
|
|
628
|
-
return this.adminforth.resource(this.resourceConfig.resourceId).update(ID, fieldsToUpdate[idx]);
|
|
602
|
+
const newRecord = Object.assign(Object.assign({}, oldRecord), fieldsToUpdate[idx]);
|
|
603
|
+
return this.adminforth.updateResourceRecord({
|
|
604
|
+
resource: this.resourceConfig,
|
|
605
|
+
recordId: ID,
|
|
606
|
+
oldRecord: oldRecord,
|
|
607
|
+
record: newRecord,
|
|
608
|
+
adminUser: adminUser,
|
|
609
|
+
});
|
|
629
610
|
}));
|
|
630
611
|
yield Promise.all(updates);
|
|
631
612
|
return { ok: true };
|
package/index.ts
CHANGED
|
@@ -625,36 +625,17 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
if (key in oldRecord) {
|
|
640
|
-
acc[key] = oldRecord[key];
|
|
641
|
-
}
|
|
642
|
-
return acc;
|
|
643
|
-
}, {} as Record<string, unknown>);
|
|
644
|
-
|
|
645
|
-
AuditLogPlugin.logCustomAction({
|
|
646
|
-
resourceId: this.resourceConfig.resourceId,
|
|
647
|
-
recordId: ID,
|
|
648
|
-
actionId: 'Bulk-ai-flow',
|
|
649
|
-
oldData: reorderedOldRecord,
|
|
650
|
-
data: fieldsToUpdate[idx],
|
|
651
|
-
user: adminUser,
|
|
652
|
-
headers: headers
|
|
653
|
-
});
|
|
654
|
-
}
|
|
655
|
-
} catch (error) { }
|
|
656
|
-
|
|
657
|
-
return this.adminforth.resource(this.resourceConfig.resourceId).update(ID, fieldsToUpdate[idx])
|
|
628
|
+
const newRecord = {
|
|
629
|
+
...oldRecord,
|
|
630
|
+
...fieldsToUpdate[idx]
|
|
631
|
+
};
|
|
632
|
+
return this.adminforth.updateResourceRecord({
|
|
633
|
+
resource: this.resourceConfig,
|
|
634
|
+
recordId: ID,
|
|
635
|
+
oldRecord: oldRecord,
|
|
636
|
+
record: newRecord,
|
|
637
|
+
adminUser: adminUser,
|
|
638
|
+
})
|
|
658
639
|
});
|
|
659
640
|
await Promise.all(updates);
|
|
660
641
|
return { ok: true };
|