feature/api-development #1
|
|
@ -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({
|
res.status(201).json({
|
||||||
success: true,
|
success: true,
|
||||||
data: toImageResponse(imageRecord),
|
data: toImageResponse(finalImage!),
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
res.status(500).json({
|
res.status(500).json({
|
||||||
|
|
|
||||||
|
|
@ -300,6 +300,7 @@ export async function createTestImage(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper to resolve alias
|
// Helper to resolve alias
|
||||||
|
// Returns format compatible with old /resolve/ endpoint: { imageId, scope, alias, image }
|
||||||
export async function resolveAlias(
|
export async function resolveAlias(
|
||||||
alias: string,
|
alias: string,
|
||||||
flowId?: string
|
flowId?: string
|
||||||
|
|
@ -310,5 +311,14 @@ export async function resolveAlias(
|
||||||
: `${endpoints.images}/${alias}`;
|
: `${endpoints.images}/${alias}`;
|
||||||
|
|
||||||
const result = await api(endpoint);
|
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,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue