Users shouldn't be able to add an empty item to their list, or add the same item twice. If they try to do this, we need to show them an error message that explains the problem. This way, we’ll prevent some clutter in their lists.
Acceptance criteria
[x] Show an error message if the user tries to submit an empty item
[x] Show an error message if the user tries to submit a new item that is identical to an existing name. For instance, if the list contains apples and the user adds apples.
[x] Show an error message if the user tries to submit a new item that matches an existing name with punctuation and casing normalized. For instance, if the list contains apples and the user adds aPples or apples, or a pples.
[x] The user’s original input is saved in the database
Notes
There are a couple of ways to approach this task. If you’re not sure how to begin, ask your mentors for advice!
Summary
Users shouldn't be able to add an empty item to their list, or add the same item twice. If they try to do this, we need to show them an error message that explains the problem. This way, we’ll prevent some clutter in their lists.
Acceptance criteria
apples
and the user addsapples
.apples
and the user addsaPples
orapples,
ora pples
.Notes