From a9884a4ad726f61daa090befc6988bdc019fece1 Mon Sep 17 00:00:00 2001 From: Asara Date: Sat, 19 Oct 2019 23:34:41 -0400 Subject: [PATCH] Figure out how to handle redirecting to newly created page --- src/actions/index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/actions/index.js b/src/actions/index.js index c4a7f5f..a3f017b 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -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') } };