Skip to content

Commit 654d2a1

Browse files
committed
Merge branch 'member-Profile-update-fix' of https://github.com/call-0f-code/COC-API into member-Profile-update-fix
2 parents a2c06a4 + d633a86 commit 654d2a1

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/utils/imageUtils.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@ export async function uploadImage(
3737
}
3838
const ext = mime.split("/")[1];
3939

40-
let filename: string;
40+
4141
if (fileUrl) {
42-
const { fileName } = extractFilePathAndNameFromUrl(fileUrl);
43-
filename = fileName;
44-
} else {
45-
filename = `${uuidv4()}.${ext}`;
42+
await deleteImage(supabase,fileUrl);
4643
}
44+
const filename:string = `${uuidv4()}.${ext}`;
4745

4846
const filePath = `${folder}/${filename}`;
4947

0 commit comments

Comments
 (0)