Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/utils/imageUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Comment thread
Harish-Naruto marked this conversation as resolved.
Outdated
}
const filename:string = `${uuidv4()}.${ext}`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const filename:string = `${uuidv4()}.${ext}`;
const filename: string = `${uuidv4()}.${ext}`;
🤖 Prompt for AI Agents
In src/utils/imageUtils.ts around line 40, the const declaration's type
annotation has incorrect spacing; remove the extra space before the equals sign
and add a single space after the colon so the declaration uses standard spacing
for type annotations and assignment (i.e., make the colon followed by one space
and no space before =).


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

Expand Down
Loading