-
Notifications
You must be signed in to change notification settings - Fork 9
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
Display error messages #70
Conversation
return ( | ||
<div className="notification"> | ||
{!!error && error.length > 0 && error.map((el: IErrorMessage) => ( | ||
<div className="notification__body" key={`${el.detail}_${Math.random().toString(36)}`}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I look forward to when we can get error message keys from the API to populate this 😄
@@ -34,6 +36,7 @@ export const Promotion: React.FC<PromotionProps> = (props) => { | |||
}) | |||
.catch(error => { | |||
console.error(error); | |||
addError(error.errors); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to call setErrors if we're displaying our own toast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shaunmaharaj,
I think we should display only our own toast. I'll update it.
That's actually what I told before. Should we use the state of a component or our own toast for displaying messages (the same is in address form, login form, and registration form)?
import { getCustomer, getAddresses, getAllOrders, loadCategoryTree, getCartItems } from './service'; | ||
import * as service from './service'; | ||
import { | ||
getCustomer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for cleaning this up!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this Petro! I left a couple comments to clarify. We can merge once resolved
Description:
Linting:
Tests:
Documentation: