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

Allow users to submit ISBNs with dashes and filter out the dashes on the backend #26

Open
laasem opened this issue Oct 21, 2020 · 0 comments

Comments

@laasem
Copy link
Contributor

laasem commented Oct 21, 2020

Is your feature request related to a problem? Please describe.
No. It adds functionality to enhance the user experience by allowing users to submit ISBNs that contain dashes and filtering the dashes out on the backend, instead of showing the user the following error:
We could not complete your request. Please make sure you entered an ISBN-10 with no dashes.

Describe the solution you'd like
In the books#create controller action, we can remove the dashes from params[:isbn] before sending it to BookService using a simple regex like so: "978-3-16-148410-0".gsub(/-/, '')

Additional context
I think this will improve the UX since users may sometimes copy their ISBNs with dashes and then have to remove them manually. If maintainers agree, I can work on this.

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

No branches or pull requests

1 participant