Last active
March 20, 2020 23:57
-
-
Save apotox/8b750511e8337c996916ff3d12d04805 to your computer and use it in GitHub Desktop.
async redux action to delete items from remote
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const DELETE_ITEMS = payload => { | |
return (dispatch, getState, api) => { | |
api.delete(`items?ids=${payload}`) | |
.then(() => { | |
//dispatch(SUCCESS_NOTIFICATION()) | |
}) | |
.catch(err => { | |
//dispatch(FAILED_NOTIFICATION(err.message)) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment