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,
|
province: true,
|
||||||
district: true,
|
district: true,
|
||||||
subDistrict: true,
|
subDistrict: true,
|
||||||
|
contact: true,
|
||||||
|
bank: true,
|
||||||
createdBy: true,
|
createdBy: true,
|
||||||
updatedBy: true,
|
updatedBy: true,
|
||||||
},
|
},
|
||||||
|
|
@ -637,6 +639,14 @@ export class BranchController extends Controller {
|
||||||
minio.removeObject(MINIO_BUCKET, fileLocation.branch.image(branchId), {
|
minio.removeObject(MINIO_BUCKET, fileLocation.branch.image(branchId), {
|
||||||
forceDelete: true,
|
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;
|
return data;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue