2021-06-30 17:21:55 +03:00
|
|
|
import { createSlice } from '@reduxjs/toolkit';
|
|
|
|
|
|
|
|
const initialState = {
|
|
|
|
tags: [],
|
|
|
|
profiles: [],
|
2021-08-09 18:40:06 +03:00
|
|
|
filteredCandidates:null,
|
2021-06-30 17:21:55 +03:00
|
|
|
selectedItems: [],
|
2021-07-02 16:02:47 +03:00
|
|
|
currentCandidate: {},
|
2021-08-04 13:04:05 +03:00
|
|
|
auth: false,
|
2021-06-30 17:21:55 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
export const outstaffingSlice = createSlice({
|
|
|
|
name: 'outstaffing',
|
|
|
|
initialState,
|
|
|
|
reducers: {
|
|
|
|
tags: (state, action) => {
|
|
|
|
state.tags = action.payload;
|
|
|
|
},
|
|
|
|
profiles: (state, action) => {
|
|
|
|
state.profiles = action.payload;
|
|
|
|
},
|
2021-07-03 17:37:30 +03:00
|
|
|
filteredCandidates: (state, action) => {
|
|
|
|
state.filteredCandidates = action.payload;
|
|
|
|
},
|
2021-07-01 14:25:17 +03:00
|
|
|
selectedItems: (state, action) => {
|
|
|
|
state.selectedItems = action.payload;
|
2021-06-30 17:21:55 +03:00
|
|
|
},
|
2021-07-02 16:02:47 +03:00
|
|
|
currentCandidate: (state, action) => {
|
|
|
|
state.currentCandidate = action.payload;
|
|
|
|
},
|
|
|
|
auth: (state, action) => {
|
|
|
|
state.auth = action.payload;
|
|
|
|
},
|
2021-06-30 17:21:55 +03:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-07-09 14:01:11 +03:00
|
|
|
export const { tags, profiles, selectedItems, auth, currentCandidate, filteredCandidates } = outstaffingSlice.actions;
|
2021-06-30 17:21:55 +03:00
|
|
|
|
|
|
|
export const selectProfiles = (state) => state.outstaffing.profiles;
|
|
|
|
export const selectTags = (state) => state.outstaffing.tags;
|
2021-07-03 17:37:30 +03:00
|
|
|
export const selectFilteredCandidates = (state) => state.outstaffing.filteredCandidates;
|
2021-06-30 17:21:55 +03:00
|
|
|
export const selectItems = (state) => state.outstaffing.selectedItems;
|
2021-07-02 16:02:47 +03:00
|
|
|
export const selectCurrentCandidate = (state) => state.outstaffing.currentCandidate;
|
|
|
|
export const selectAuth = (state) => state.outstaffing.auth;
|
2021-06-30 17:21:55 +03:00
|
|
|
|
|
|
|
export default outstaffingSlice.reducer;
|