Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function* submitSettingsSaga(action) {
- yield put(actions.submitSettingsStart());
- try {
- const response = yield axios.patch(`/useCases/${action.useCaseId}.json`, action.data);
- yield put(actions.submitSettingsSuccess(response.data));
- try {
- const response = yield axios.get('/useCases.json');
- const fetchedData = [];
- for (let key in response.data) {
- fetchedData.push({
- ...response.data[key],
- id: key
- });
- }
- yield put(actions.fetchUseCaseDataSuccess(fetchedData));
- } catch (error) {
- yield put(actions.fetchUseCaseDataFailed(error));
- }
- } catch (error) {
- yield put(actions.submitSettingsFail(error))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement