feat: also remove file when delete data
This commit is contained in:
parent
277860805b
commit
185de6eda8
1 changed files with 10 additions and 0 deletions
|
|
@ -616,6 +616,8 @@ export class BranchController extends Controller {
|
|||
province: true,
|
||||
district: true,
|
||||
subDistrict: true,
|
||||
contact: true,
|
||||
bank: true,
|
||||
createdBy: true,
|
||||
updatedBy: true,
|
||||
},
|
||||
|
|
@ -637,6 +639,14 @@ export class BranchController extends Controller {
|
|||
minio.removeObject(MINIO_BUCKET, fileLocation.branch.image(branchId), {
|
||||
forceDelete: true,
|
||||
}),
|
||||
minio.removeObject(MINIO_BUCKET, fileLocation.branch.map(branchId), {
|
||||
forceDelete: true,
|
||||
}),
|
||||
...data.bank.map(async (v) => {
|
||||
await minio.removeObject(MINIO_BUCKET, fileLocation.branch.bank(branchId, v.id), {
|
||||
forceDelete: true,
|
||||
});
|
||||
}),
|
||||
]);
|
||||
|
||||
return data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue