when creating a new Event Type (Meeting Type) through an axios post request, addMeetingType function is called from UserProvider context and the new Event Type is passed in which updates the user state before redirecting to the Dashboard:
const addMeetingTypes = (newMeetingType) => {
setUser(prevUser => {
return {
user: {
// copies the previous user object
...prevUser.user,
// appends the newMeetingType created to the meetingTypes object
meetingTypes: [...prevUser.user.meetingTypes, newMeetingType]
}
}});
}
What to Look For
DRY code
code review from #59 will be addressed here
What to Avoid
59 will not be merged in as this one includes all of the commits from that branch
context performing the actions that would make more sense in a reducer
What it Does
What to Look For
What to Avoid
59 will not be merged in as this one includes all of the commits from that branch