1
0
Fork 0

Figure out how to handle redirecting to newly created page

This commit is contained in:
Amarpreet Minhas 2019-10-19 23:34:41 -04:00
parent 04a64d3026
commit a9884a4ad7

View file

@ -39,10 +39,7 @@ export const loadCookieToState = (data) => async (dispatch) => {
export const newBlogPost = (payload) => async (dispatch) => {
const response = await sudoscientist.post('/blog', payload)
if (response.status === 401) {
dispatch({ type: 'BLOG_POST_FAILED', payload: null })
}
if (response.status === 200) {
dispatch({ type: 'BLOG_POST_CREATED', payload: response })
if (response.status === 201) {
console.log('CREATED')
}
};