fix: image not on delete data

This commit is contained in:
Methapon2001 2024-04-04 11:02:01 +07:00
parent 48c9fe1cfd
commit 88f84256cf
2 changed files with 7 additions and 0 deletions

View file

@ -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,