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: prevent spaces in snippet name and show error message #736

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

siva222003
Copy link
Contributor

Fix: #725

  • Added validation to prevent spaces in snippet names and avoid unnecessary API calls.
  • Displayed an error message when a user tries to enter a name with spaces.
Screencast.from.2025-03-21.18-31-21.webm

Please let me know if any changes are required.

Copy link
Member

@imrishabh18 imrishabh18 left a comment

Choose a reason for hiding this comment

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

I don't think this is the right implementation. Better would be the backend to handle this and send the error message.

@siva222003
Copy link
Contributor Author

I don't think this is the right implementation. Better would be the backend to handle this and send the error message.

@imrishabh18 Yeah, that would be better, but since the issue was raised here, I thought of resolving it from the frontend itself. This way, there's no need to send an API request.

@imrishabh18
Copy link
Member

You can check the fake-snippet directory, it has the backend routes where you can add this. If all looks good, I can then implement the same logic in the prod backend

@siva222003
Copy link
Contributor Author

You can check the fake-snippet directory, it has the backend routes where you can add this. If all looks good, I can then implement the same logic in the prod backend

Alright, will implement that.

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.

Fix the error message and support snippet name with spaces
2 participants