fix: missing image url
This commit is contained in:
parent
f9fdfce9ba
commit
7bd3c2ebd3
1 changed files with 7 additions and 1 deletions
|
|
@ -86,7 +86,13 @@ export class CustomerController extends Controller {
|
|||
const record = await prisma.customer.findFirst({ where: { id: customerId } });
|
||||
if (!record)
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "Customer cannot be found.", "data_not_found");
|
||||
return record;
|
||||
return Object.assign(record, {
|
||||
imageUrl: await minio.presignedGetObject(
|
||||
MINIO_BUCKET,
|
||||
imageLocation(record.id),
|
||||
12 * 60 * 60,
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
@Post()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue