import { slaughterHouseVetGetComplaints } from "../../../features/slaughter-house-vet/services/slaughter-house-vet-get-complaints";
import { slaughterHouseVetGetProfile } from "../../../features/slaughter-house-vet/services/slaughter-house-vet-get-profile";
import { slaughterHouseVetNewRequests } from "../../../features/slaughter-house-vet/services/slaughter-house-vet-new-requests";

export const slaughterHouseVetExtraReducers = {
  [slaughterHouseVetGetProfile.fulfilled]: (state, { payload }) => {
    state.profile = payload.data;
    state.pending = false;
  },
  [slaughterHouseVetGetProfile.pending]: (state) => {
    state.pending = true;
  },
  [slaughterHouseVetNewRequests.fulfilled]: (state, { payload }) => {
    state.newRequests = payload.data;
    state.pending = false;
  },
  [slaughterHouseVetNewRequests.pending]: (state) => {
    state.pending = true;
  },
  [slaughterHouseVetGetComplaints.fulfilled]: (state, { payload }) => {
    state.pending = false;
    state.slaughterHouseVetComplaints = payload.data;
  },
  [slaughterHouseVetGetComplaints.pending]: (state) => {
    state.pending = true;
  },
};
