@kumori/aurora-backend-handler 1.0.46 → 1.0.47
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/helpers/revision-helper.ts +7 -17
- package/package.json +1 -1
|
@@ -217,27 +217,17 @@ const updateServiceWithRevision = (
|
|
|
217
217
|
const existingRevisionIndex = existingService.revisions.findIndex(
|
|
218
218
|
(rev) => rev.id === entityId,
|
|
219
219
|
);
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
updatedRevisions =
|
|
227
|
-
existingRevisionIndex === -1
|
|
228
|
-
? [...existingService.revisions, newRevision]
|
|
229
|
-
: existingService.revisions.map((rev) =>
|
|
230
|
-
rev.id === entityId ? newRevision : rev,
|
|
231
|
-
);
|
|
232
|
-
} else {
|
|
233
|
-
updatedRevisions = existingService.revisions.filter(
|
|
234
|
-
(rev) => rev.id !== entityId,
|
|
235
|
-
);
|
|
236
|
-
}
|
|
220
|
+
const updatedRevisions: Revision[] =
|
|
221
|
+
existingRevisionIndex === -1
|
|
222
|
+
? [...existingService.revisions, newRevision]
|
|
223
|
+
: existingService.revisions.map((rev) =>
|
|
224
|
+
rev.id === entityId ? newRevision : rev,
|
|
225
|
+
);
|
|
237
226
|
|
|
238
227
|
const updatedService: Service = {
|
|
239
228
|
...existingService,
|
|
240
229
|
revisions: updatedRevisions,
|
|
230
|
+
currentRevision: entityId,
|
|
241
231
|
role: roles.length > 0 ? roles : existingService.role,
|
|
242
232
|
usage: newRevision.usage,
|
|
243
233
|
startedAt: newRevision.createdAt || existingService.startedAt,
|