refactor: change to response url instead
This commit is contained in:
parent
95d657f7e2
commit
7e03c239d3
2 changed files with 8 additions and 12 deletions
|
|
@ -574,12 +574,10 @@ export class CustomerAttachmentController extends Controller {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return req.res?.redirect(
|
return await minio.presignedGetObject(
|
||||||
await minio.presignedGetObject(
|
MINIO_BUCKET,
|
||||||
MINIO_BUCKET,
|
`${attachmentLocation(record.customerId, branchId)}/${filename}`,
|
||||||
`${attachmentLocation(record.customerId, branchId)}/${filename}`,
|
12 * 60 * 60,
|
||||||
12 * 60 * 60,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -819,12 +819,10 @@ export class EmployeeAttachmentController extends Controller {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "Employee cannot be found.", "employeeNotFound");
|
throw new HttpError(HttpStatus.NOT_FOUND, "Employee cannot be found.", "employeeNotFound");
|
||||||
}
|
}
|
||||||
|
|
||||||
return req.res?.redirect(
|
return await minio.presignedGetObject(
|
||||||
await minio.presignedGetObject(
|
MINIO_BUCKET,
|
||||||
MINIO_BUCKET,
|
attachmentLocation(record.id, filename),
|
||||||
attachmentLocation(record.id, filename),
|
12 * 60 * 60,
|
||||||
12 * 60 * 60,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue