guild_front/src/redux/outstaffingSlice.js

56 lines
1.7 KiB
JavaScript
Raw Normal View History

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-08-17 12:38:12 +03:00
positionId: null,
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-08-17 12:38:12 +03:00
setPositionId: (state, action) => {
state.positionId = action.payload;
},
2022-02-11 15:34:31 +02:00
setUserInfo: (state, action) => {
state.userInfo = action.payload;
}
2021-06-30 17:21:55 +03:00
},
});
2022-02-11 15:34:31 +02:00
export const { tags, profiles, selectedItems, auth, currentCandidate, filteredCandidates, setPositionId, setUserInfo } = 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-08-17 12:38:12 +03:00
export const getPositionId = (state) => state.outstaffing.positionId;
2022-02-11 15:34:31 +02:00
export const selectUserInfo = (state) => state.outstaffing.userInfo;
2021-06-30 17:21:55 +03:00
export default outstaffingSlice.reducer;