Figure out how to handle redirecting to newly created page
This commit is contained in:
parent
04a64d3026
commit
a9884a4ad7
1 changed files with 2 additions and 5 deletions
|
@ -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')
|
||||
}
|
||||
};
|
||||
|
|
Reference in a new issue