added if else clause in fetchContext

So that if we get an error, then we will
only delete status if it is an 404 error
lolsob-rspec
Rakib Hasan 2017-02-19 10:54:27 +00:00
parent 4909069b7b
commit 620cba2e2a
1 changed files with 6 additions and 2 deletions

View File

@ -103,8 +103,12 @@ export function fetchContext(id) {
dispatch(fetchContextSuccess(id, response.data.ancestors, response.data.descendants));
dispatch(fetchStatusCard(id));
}).catch(error => {
if (error.response.status == 404){
dispatch(deleteStatusSuccess(id));
dispatch(deleteFromTimelines(id));
}else{
dispatch(fetchContextFail(id, error));
}
});
};
};