feat: image upload product service

This commit is contained in:
Methapon Metanipat 2024-09-10 15:19:31 +07:00
parent 615ba4e214
commit 8e1a32dcf3
3 changed files with 112 additions and 7 deletions

View file

@ -22,6 +22,10 @@ export async function getFile(path: string, exp = 60 * 60) {
return await minio.presignedGetObject(MINIO_BUCKET, path, exp);
}
export async function setFile(path: string, exp = 6 * 60 * 60) {
return await minio.presignedPutObject(MINIO_BUCKET, path, exp);
}
export async function deleteFile(path: string) {
await minio.removeObject(MINIO_BUCKET, path, { forceDelete: true });
}