-
Notifications
You must be signed in to change notification settings - Fork 1
#67 delete activities #81
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
Changes from 1 commit
833aaf5
001a70d
6b9ef0b
14e25b8
2d40594
e330c6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,21 @@ export function activityManagementReducer(state: ActivityState = initialState, a | |
message: 'Something went wrong creating activities!', | ||
}; | ||
} | ||
case ActivityManagementActionTypes.DELETE_ACTIVITY: { | ||
return { | ||
...state, | ||
message: 'Activity removed successfully!', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you need to set the loading variable to true. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @daros10 you don't need to add "message: 'Activity removed successfully!'," that is only in DELETE_ACTIVITY_SUCCESS |
||
}; | ||
} | ||
|
||
case ActivityManagementActionTypes.DELETE_ACTIVITY_SUCCESS: { | ||
const activites = state.data.filter((activity) => activity.id !== action.activityId); | ||
return { | ||
data: activites, | ||
isLoading: false, | ||
message: 'Activity removed successfully!', | ||
}; | ||
} | ||
default: | ||
return state; | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.