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) => {
|
export const newBlogPost = (payload) => async (dispatch) => {
|
||||||
const response = await sudoscientist.post('/blog', payload)
|
const response = await sudoscientist.post('/blog', payload)
|
||||||
if (response.status === 401) {
|
if (response.status === 201) {
|
||||||
dispatch({ type: 'BLOG_POST_FAILED', payload: null })
|
console.log('CREATED')
|
||||||
}
|
|
||||||
if (response.status === 200) {
|
|
||||||
dispatch({ type: 'BLOG_POST_CREATED', payload: response })
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Reference in a new issue