42 lines
1.0 KiB
JavaScript
42 lines
1.0 KiB
JavaScript
import { createSlice } from "@reduxjs/toolkit";
|
|
|
|
const initialState = {
|
|
jobListTable: false,
|
|
pendingListTable: false,
|
|
myTaskTable: false,
|
|
othersInterestedTable: false,
|
|
couponTable: false
|
|
};
|
|
|
|
export const tableReloadSlice = createSlice({
|
|
name: "tableReload",
|
|
initialState,
|
|
reducers: {
|
|
tableReload: (state, action) => {
|
|
switch (action.payload.type) {
|
|
case "JOBTABLE":
|
|
state.jobListTable = !state.jobListTable;
|
|
return;
|
|
case "PENDINGTABLE":
|
|
state.pendingListTable = !state.pendingListTable;
|
|
return;
|
|
case "MYTASKTABLE":
|
|
state.myTaskTable = !state.myTaskTable;
|
|
return;
|
|
case "OTHERSINTERESTEDTABLE":
|
|
state.othersInterestedTable = !state.othersInterestedTable;
|
|
return;
|
|
case "COUPONTABLE":
|
|
state.couponTable = !state.couponTable;
|
|
return;
|
|
default:
|
|
return state;
|
|
}
|
|
},
|
|
},
|
|
});
|
|
|
|
export const { tableReload } = tableReloadSlice.actions;
|
|
|
|
export default tableReloadSlice.reducer;
|