From 39c3961206165c0f77146f251f95d2a810fc77d6 Mon Sep 17 00:00:00 2001 From: 2paperstar Date: Fri, 7 Jun 2024 12:12:12 +0900 Subject: [PATCH] fix: ai response --- src/ai/ai.service.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ai/ai.service.ts b/src/ai/ai.service.ts index acd20ba..fba3cb4 100644 --- a/src/ai/ai.service.ts +++ b/src/ai/ai.service.ts @@ -35,14 +35,18 @@ export class AiService { } async getLookBookByUserUuid(userUuid: string) { - const results = await this.aiRepository.getLookBookByUserUuid(userUuid); + const { list, ...results } = + await this.aiRepository.getLookBookByUserUuid(userUuid); - return await Promise.all( - results.list.map(async ({ imageUuid, ...result }) => ({ - ...result, - imageUrl: await this.fileService.getSignedUrl(imageUuid), - })), - ); + return { + ...results, + list: await Promise.all( + list.map(async ({ imageUuid, ...result }) => ({ + ...result, + imageUrl: await this.fileService.getSignedUrl(imageUuid), + })), + ), + }; } async createLookBook(