actionCategoryUpdate.js 591 B

1234567891011121314
  1. import { call, put } from "redux-saga/effects";
  2. import { promiseWorker } from "../reducers/promiseReducer";
  3. import { actionCatAll } from "./actionCatAll";
  4. import { actionCategoryUpsert } from "./actionCategoryUpsert";
  5. import { actionRootCats } from "./actionRootCats";
  6. export const actionCategoryUpdate = (category) => ({ type: "CATEGORY_UPDATE", payload: category });
  7. export function* categoryUpdateWorker(action) {
  8. const category = action.payload || {};
  9. yield call(promiseWorker, actionCategoryUpsert(category));
  10. yield put(actionCatAll());
  11. yield put(actionRootCats());
  12. }