refactor: change to response url instead

This commit is contained in:
Methapon Metanipat 2024-08-27 11:56:58 +07:00
parent 95d657f7e2
commit 7e03c239d3
2 changed files with 8 additions and 12 deletions

View file

@ -574,12 +574,10 @@ export class CustomerAttachmentController extends Controller {
);
}
return req.res?.redirect(
await minio.presignedGetObject(
MINIO_BUCKET,
`${attachmentLocation(record.customerId, branchId)}/${filename}`,
12 * 60 * 60,
),
return await minio.presignedGetObject(
MINIO_BUCKET,
`${attachmentLocation(record.customerId, branchId)}/${filename}`,
12 * 60 * 60,
);
}

View file

@ -819,12 +819,10 @@ export class EmployeeAttachmentController extends Controller {
throw new HttpError(HttpStatus.NOT_FOUND, "Employee cannot be found.", "employeeNotFound");
}
return req.res?.redirect(
await minio.presignedGetObject(
MINIO_BUCKET,
attachmentLocation(record.id, filename),
12 * 60 * 60,
),
return await minio.presignedGetObject(
MINIO_BUCKET,
attachmentLocation(record.id, filename),
12 * 60 * 60,
);
}