(W4) Nikema and Mike (Check Input Values if there are Duplicates in Database)
7. As a user, I want to be alerted when I’m entering an item that is the same as something already on my list so I can avoid duplicate items #29
- 7.1 Show an error message if the user tries to submit a new item that has the exact same name as an existing item
- 7.2 Show an error message if the user tries to submit a new item that has the same name as an existing item, where capitalization has been normalized and punctuation has been removed
- 7.3 The user’s original input should be what gets saved in the database
Problem Solving (George Polya)
- To solve a problem, ask these questions
- What are the unknown aspects?
- What do you know? What data do you have?
- What constraints and what rules apply?
Sync January 6th
- Review & Understand Story
- Set Week Plan
- Parking Lot (Things we brought up but not important)
- 7.1 We will use a ruby error from Mike's old code
- 7.2 Regular Expression? Would this be the best route or should we use Mike's Normalized?
- Regex /Regular Expression
input = input.replace(/[^a-zA-Z\s]/g, "").toLowerCase() // will strip out all non-letters except whitespace, then lowercase the string
- 7.3 The user’s original input should be what gets saved in the database. Whatever the originally put in the box gets saved but you check if doesn't match what is already on the list. Andrew?
- 7.1 Mike
- 7.2 Nikema
- Nikema will create a branch and PR Draft ✅
- We will meet again Wed @ 8pm
- Maybe a little Cypress at the end of the week??
- Maybe make this app a little prettier???
Mike, another way to handle the error message is with conditional rendering. Something to think about?