fix: missing qr code image url on get

This commit is contained in:
Methapon2001 2024-04-03 12:49:42 +07:00
parent e7568fa06f
commit b1b93f0e34

View file

@ -58,7 +58,21 @@ export class BranchContactController extends Controller {
prisma.branchContact.count({ where: { branchId } }),
]);
return { result, page, pageSize, total };
return {
result: await Promise.all(
result.map(async (v) => ({
...v,
qrCodeImageUrl: await minio.presignedGetObject(
MINIO_BUCKET,
imageLocation(v.id),
12 * 60 * 60,
),
})),
),
page,
pageSize,
total,
};
}
@Get("{contactId}")