Conversation
… the user already saved it
tyleryy
left a comment
There was a problem hiding this comment.
requested some minor changes.
| ) : | ||
| "Sorry, an error occurred while saving your search term. Please try again.", | ||
| status: success ? (description === "added" ? "success" : "info") : "error", | ||
| title: success |
There was a problem hiding this comment.
might be better to unnest the conditions from the toast objects, just so it is a little cleaner. Currently, it is toast -> API check -> description "added" check (where -> means nested conditional).
Maybe do API check -> toast -> description added?
if you do it this way, the fail api check should be the same i believe. and then the success api check will have two different toast jsons.
its kind of like making a more efficient tree. the new way is shallower (2 levels) and the current way is deeper (like 3 levels)
|
|
||
| const addKeyword = async (keyword) => { | ||
| if (keywords.includes(keyword)) { | ||
| return { success: true, description: "existing" }; |
There was a problem hiding this comment.
idk how else description is being used in this api response, but there seem to be only two states (existing and added). Maybe use a boolean?
|
Sorry, i don't know why I didn't see the notification/email for this review weeks ago, so I just saw it now. Lmk if these changes reflects what you meant. |
… the user already saved it
Closes #122