Skip to content
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

feat: Adds simple file validation #36

Closed
wants to merge 3 commits into from
Closed

Conversation

AbrahamX3
Copy link

@AbrahamX3 AbrahamX3 commented Nov 10, 2024

Description

This PR adds simple file validation when handling Image and SVG file uploads using their mime type. The error is displayed via a toast using sonner (useful for handling future error messages!)

Preview

Arc_KQFjEXjlrm.mp4

Current

Production currently lets you upload any file type, so this PR fixes that.

image

Copy link

vercel bot commented Nov 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
quickpic ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 10, 2024 10:15am

@AbrahamX3
Copy link
Author

Also added toast errors in case file is somehow missing when uploading a file.

@t3dotgg
Copy link
Owner

t3dotgg commented Nov 11, 2024

I added a shitty alert before I saw this 😭 down to rebase it on current state and move the alerts there?

@AbrahamX3
Copy link
Author

I added a shitty alert before I saw this 😭 down to rebase it on current state and move the alerts there?

Sure thing, I made validation even better and more dynamic for future tools, check out #65!

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.

2 participants