fix: backward compat

This commit is contained in:
Methapon Metanipat 2024-09-06 14:13:00 +07:00
parent 34f574646b
commit 015c119d3f

View file

@ -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()