import { driverGetCars } from "../../../features/driver/services/driver-get-cars";
import { driverGetProfile } from "../../../features/driver/services/driver-get-profile";
import { driverGetRequests } from "../../../features/driver/services/driver-get-requests";

export const driverExtraReducers = {
  [driverGetRequests.fulfilled]: (state, { payload }) => {
    state.driverRequests = payload.data;
    state.pending = false;
  },
  [driverGetRequests.pending]: (state) => {
    state.pending = true;
  },
  [driverGetCars.fulfilled]: (state, { payload }) => {
    state.driverCars = payload.data;
    state.pending = false;
  },
  [driverGetCars.pending]: (state) => {
    state.pending = true;
  },
  [driverGetProfile.fulfilled]: (state, { payload }) => {
    state.profile = payload.data.profile;
    state.pending = false;
  },
  [driverGetProfile.pending]: (state) => {
    state.pending = true;
  },
};
