From 3e3f15cd9c454bcf23807cac91eaa9977e34c9d8 Mon Sep 17 00:00:00 2001 From: Oleg Proskurin Date: Sun, 16 Nov 2025 22:46:39 +0700 Subject: [PATCH] fix: live endpoint --- apps/api-service/src/routes/v1/live.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/api-service/src/routes/v1/live.ts b/apps/api-service/src/routes/v1/live.ts index eea1faf..36fd7eb 100644 --- a/apps/api-service/src/routes/v1/live.ts +++ b/apps/api-service/src/routes/v1/live.ts @@ -86,9 +86,9 @@ liveRouter.get( const storageService = await StorageFactory.getInstance(); // Parse storage key to get components - // Format: orgId/projectId/category/year-month/filename.ext + // Format: orgId/projectId/category/filename.ext const keyParts = image.storageKey.split('/'); - if (keyParts.length < 5) { + if (keyParts.length < 4) { throw new Error('Invalid storage key format'); } @@ -153,8 +153,9 @@ liveRouter.get( // Download newly generated image const storageService = await StorageFactory.getInstance(); + // Format: orgId/projectId/category/filename.ext const keyParts = generation.outputImage.storageKey.split('/'); - if (keyParts.length < 5) { + if (keyParts.length < 4) { throw new Error('Invalid storage key format'); }