Skip to content

Conversation

@Pacodastre
Copy link
Contributor

I changed some statusMessage to message in the files I touched. Let me know if I shouldn't have done that.
It shows an error message when a file is not a valid image
I fixed a minor bug in the game logo upload. If an invalid image was selected, then saved. Upon reopening the modal to upload the logo, the image used to appear broken as it was trying to render the previous invalid image. This is fixed by not updating the logo if it's not valid.

@Pacodastre Pacodastre force-pushed the only-accept-valid-images-for-upload branch from e12a96f to 3eaaf1c Compare February 9, 2026 07:38
Copy link
Member

@DecDuck DecDuck left a comment

Choose a reason for hiding this comment

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

statusMessage -> message is fine.

Just a comment about refactoring the MIME type check.

throw createError({ statusCode: 400, statusMessage: "Invalid company id" });
throw createError({ statusCode: 400, message: "Invalid company id" });

const formData = await readMultipartFormData(h3);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe build this functionality into the handleFileUpload util? Like an optional argument that defines valid MIME types or MIME type prefixes

Comment on lines +3 to +10
export const IMAGE_EXTENSIONS = [
"bmp",
"gif",
"ico",
"jpeg",
"heic",
"png",
"tiff",
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we absolutely need to cover every possible item, but support for svg, webp, avif, and maybe even jxl are a must imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants