From beedac385e15a51d84f665ef7abddf436ed81152 Mon Sep 17 00:00:00 2001 From: Oleg Proskurin Date: Wed, 26 Nov 2025 00:22:34 +0700 Subject: [PATCH] fix: basic --- apps/api-service/src/routes/v1/images.ts | 5 ++++- tests/api/utils.ts | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/api-service/src/routes/v1/images.ts b/apps/api-service/src/routes/v1/images.ts index 9660e90..06cea6a 100644 --- a/apps/api-service/src/routes/v1/images.ts +++ b/apps/api-service/src/routes/v1/images.ts @@ -298,9 +298,12 @@ imagesRouter.post( } } + // Refetch image to include any updates (alias assignment, flow alias) + const finalImage = await service.getById(imageRecord.id); + res.status(201).json({ success: true, - data: toImageResponse(imageRecord), + data: toImageResponse(finalImage!), }); } catch (error) { res.status(500).json({ diff --git a/tests/api/utils.ts b/tests/api/utils.ts index d604ea2..debaf98 100644 --- a/tests/api/utils.ts +++ b/tests/api/utils.ts @@ -300,6 +300,7 @@ export async function createTestImage( } // Helper to resolve alias +// Returns format compatible with old /resolve/ endpoint: { imageId, scope, alias, image } export async function resolveAlias( alias: string, flowId?: string @@ -310,5 +311,14 @@ export async function resolveAlias( : `${endpoints.images}/${alias}`; const result = await api(endpoint); - return result.data.data; + const image = result.data.data; + + // Adapt response to match old /resolve/ format for test compatibility + return { + imageId: image.id, + alias: image.alias || alias, + scope: image.flowId ? 'flow' : 'project', + flowId: image.flowId, + image, + }; }