diff --git a/src/controllers/branch/contact-controller.ts b/src/controllers/branch/contact-controller.ts index ecd4917..3f22d75 100644 --- a/src/controllers/branch/contact-controller.ts +++ b/src/controllers/branch/contact-controller.ts @@ -25,6 +25,10 @@ if (!process.env.MINIO_BUCKET) { const MINIO_BUCKET = process.env.MINIO_BUCKET; +function imageLocation(id: string) { + return `branch/contact-${id}`; +} + @Route("api/branch/{branchId}/contact") @Tags("Branch Contact") @Security("keycloak") @@ -45,12 +49,12 @@ export class BranchContactController extends Controller { return Object.assign(record, { qrCodeImageUrl: await minio.presignedGetObject( MINIO_BUCKET, - `branch/contact-${record.id}`, + imageLocation(record.id), 12 * 60 * 60, ), qrCodeImageUploadUrl: await minio.presignedPutObject( MINIO_BUCKET, - `branch/contact-${record.id}`, + imageLocation(record.id), 12 * 60 * 60, ), });