-
Notifications
You must be signed in to change notification settings - Fork 6
refactor image update logic in uploadImg function #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
d633a86
654d2a1
a51fb63
e2ec074
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -37,13 +37,11 @@ export async function uploadImage( | |||||
| } | ||||||
| const ext = mime.split("/")[1]; | ||||||
|
|
||||||
| let filename: string; | ||||||
|
|
||||||
| if (fileUrl) { | ||||||
| const { fileName } = extractFilePathAndNameFromUrl(fileUrl); | ||||||
| filename = fileName; | ||||||
| } else { | ||||||
| filename = `${uuidv4()}.${ext}`; | ||||||
| await deleteImage(supabase,fileUrl); | ||||||
| } | ||||||
| const filename:string = `${uuidv4()}.${ext}`; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix type annotation spacing. The type annotation is missing a space after the colon, and there's an extra space before the equals sign. Apply this diff to fix the formatting: - const filename:string = `${uuidv4()}.${ext}`;
+ const filename: string = `${uuidv4()}.${ext}`;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| const filePath = `${folder}/${filename}`; | ||||||
|
|
||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.