Last active
July 16, 2016 21:00
-
-
Save jacobp100/8c603ccd279edcb961d85fec4fee754f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 updateRemoveCatViaForm = inputParams => async dispatch => { | |
const { action, id } = inputParams; | |
const params = await schema.validate(inputParams, { | |
abortEarly: false, | |
stripUnknown: true, | |
}); | |
return await action === 'remove' | |
? dispatch(removeCat(id)) | |
: dispatch(updateCat(id, params)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment