| @@ -44,6 +44,8 @@ import { | |||
| selectPinnedOffers, | |||
| selectTotalOffers, | |||
| } from "../selectors/offersSelectors"; | |||
| import history from "../utils/history"; | |||
| import { NOT_FOUND_PAGE } from "../../constants/pages"; | |||
| function* fetchOffers(payload) { | |||
| try { | |||
| @@ -123,7 +125,10 @@ function* fetchOneOffer(payload) { | |||
| console.log(data.data); | |||
| yield put(setOffer(data.data)); | |||
| } catch (e) { | |||
| console.log(e); | |||
| console.log(e.response.status); | |||
| if (e.response.status === 400) { | |||
| yield call(history.push, NOT_FOUND_PAGE); | |||
| } | |||
| } | |||
| } | |||
| @@ -145,6 +150,9 @@ function* fetchProfileOffers(payload) { | |||
| yield put(setProfileOffers(data.data)); | |||
| } catch (e) { | |||
| console.log(e); | |||
| if (e.response.status === 400) { | |||
| yield call(history.push, NOT_FOUND_PAGE); | |||
| } | |||
| } | |||
| } | |||