added if else clause in fetchContext
So that if we get an error, then we will only delete status if it is an 404 errorlolsob-rspec
parent
4909069b7b
commit
620cba2e2a
|
@ -103,8 +103,12 @@ export function fetchContext(id) {
|
||||||
dispatch(fetchContextSuccess(id, response.data.ancestors, response.data.descendants));
|
dispatch(fetchContextSuccess(id, response.data.ancestors, response.data.descendants));
|
||||||
dispatch(fetchStatusCard(id));
|
dispatch(fetchStatusCard(id));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
dispatch(deleteStatusSuccess(id));
|
if (error.response.status == 404){
|
||||||
dispatch(deleteFromTimelines(id));
|
dispatch(deleteStatusSuccess(id));
|
||||||
|
dispatch(deleteFromTimelines(id));
|
||||||
|
}else{
|
||||||
|
dispatch(fetchContextFail(id, error));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue