Last active
July 14, 2016 19:42
-
-
Save jacobp100/8f3455ca6b7b39d29d5a631cdcdbe0be 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 addCat = params => async dispatch => { | |
const cat = await fetchJson('PUT', '/cats', params); | |
dispatch({ type: UPDATE_CAT, cat }); | |
}; | |
export const addCatViaForm = inputParams => async dispatch => { | |
const params = await schema.validate(inputParams, { | |
abortEarly: false, | |
stripUnknown: true, | |
}); | |
dispatch(addCat(params)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment