fix: image not on delete data
This commit is contained in:
parent
48c9fe1cfd
commit
88f84256cf
2 changed files with 7 additions and 0 deletions
|
|
@ -161,5 +161,8 @@ export class BranchContactController extends Controller {
|
|||
if (result.count <= 0) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "Branch cannot be found.", "data_not_found");
|
||||
}
|
||||
await minio.removeObject(MINIO_BUCKET, imageLocation(contactId), {
|
||||
forceDelete: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -325,6 +325,10 @@ export class UserController extends Controller {
|
|||
throw new HttpError(HttpStatus.FORBIDDEN, "User is in used.", "data_in_used");
|
||||
}
|
||||
|
||||
await minio.removeObject(MINIO_BUCKET, imageLocation(userId), {
|
||||
forceDelete: true,
|
||||
});
|
||||
|
||||
return await prisma.user.delete({
|
||||
include: {
|
||||
province: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue