diff --git a/src/controllers/02-user-controller.ts b/src/controllers/02-user-controller.ts index 5f3c8b1..4d8de86 100644 --- a/src/controllers/02-user-controller.ts +++ b/src/controllers/02-user-controller.ts @@ -856,7 +856,17 @@ export class UserAttachmentController extends Controller { throw new HttpError(HttpStatus.NOT_FOUND, "User cannot be found.", "userNotFound"); } - return await listFile(fileLocation.user.attachment(userId)); + const list = await listFile(fileLocation.user.attachment(userId)); + return await Promise.all( + list.map(async (v) => ({ + name: v, + url: await minio.presignedGetObject( + MINIO_BUCKET, + fileLocation.user.attachment(userId, v), + 12 * 60 * 60, + ), + })), + ); } @Post()