-
-
Notifications
You must be signed in to change notification settings - Fork 359
Add locations CRUD UI #342
Add locations CRUD UI #342
Conversation
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.
Mostly looks good, a few comments.
@@ -0,0 +1,19 @@ | |||
export const FETCH_START = 'fcc/chapter/LOCATIONS_START'; |
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.
these probably aren't necessary with typescript, but it doesn't matter for now
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.
Why not? They're simpler to use because you can easily autocomplete them + less to type
data, | ||
), | ||
); | ||
router.replace('/dashboard/locations'); |
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.
why replace instead of push?
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.
Hmm, here we could have a push. But this was copied from the create action to which you don't want to go back to, unless you want to create multiple of the same which you most likely don't want to do
pages/dashboard/locations/new.tsx
Outdated
|
||
const onSubmit = async data => { | ||
await dispatch(locationActions.create(data)); | ||
router.replace('/dashboard/locations'); |
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.
same re replace vs push. push is generally preferred.
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.
Yes, but here I'd argue that we should keep replace because when you create something you don't want to go back to the new page. Or do we maybe? (longer explanation in a comment before)
…ocation then we'd need to delete the chapter...)
Add UI for #340