@kumori/aurora-backend-handler 1.0.55 → 1.0.56
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 +13 -2
- package/package.json +1 -1
|
@@ -215,13 +215,24 @@ const updateServiceWithRevision = (
|
|
|
215
215
|
roles: Role[],
|
|
216
216
|
): { updatedService: Service; deploymentErrorEvent: Service | null } => {
|
|
217
217
|
const existingRevisionIndex = existingService.revisions.findIndex(
|
|
218
|
-
(rev) => rev.id === entityId,
|
|
218
|
+
(rev) => String(rev.id) === String(entityId),
|
|
219
219
|
);
|
|
220
|
+
const existingRevision = existingRevisionIndex !== -1
|
|
221
|
+
? existingService.revisions[existingRevisionIndex]
|
|
222
|
+
: null;
|
|
223
|
+
const hasExistingSchema = existingRevision?.schema &&
|
|
224
|
+
("parameters" in existingRevision.schema || "resources" in existingRevision.schema);
|
|
225
|
+
const hasNewSchema = newRevision.schema &&
|
|
226
|
+
("parameters" in newRevision.schema || "resources" in newRevision.schema);
|
|
227
|
+
if (hasExistingSchema && !hasNewSchema) {
|
|
228
|
+
newRevision.schema = existingRevision!.schema;
|
|
229
|
+
}
|
|
230
|
+
|
|
220
231
|
const updatedRevisions: Revision[] =
|
|
221
232
|
existingRevisionIndex === -1
|
|
222
233
|
? [...existingService.revisions, newRevision]
|
|
223
234
|
: existingService.revisions.map((rev) =>
|
|
224
|
-
rev.id === entityId ? newRevision : rev,
|
|
235
|
+
String(rev.id) === String(entityId) ? newRevision : rev,
|
|
225
236
|
);
|
|
226
237
|
|
|
227
238
|
const updatedService: Service = {
|