guild_front/src/redux/outstaffingSlice.js

53 lines
1.5 KiB
JavaScript
Raw Normal View History

2021-06-30 17:21:55 +03:00
import { createSlice } from '@reduxjs/toolkit';
const initialState = {
tags: [],
profiles: [],
candidates: [],
selectedItems: [],
2021-07-02 16:02:47 +03:00
selectedTab: '',
currentCandidate: {},
auth: true,
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;
},
candidates: (state, action) => {
state.candidates = action.payload;
},
selectedTab: (state, action) => {
state.selectedTab = 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-02 16:02:47 +03:00
export const { tags, profiles, candidates, selectedTab, selectedItems, auth, currentCandidate } =
outstaffingSlice.actions;
2021-06-30 17:21:55 +03:00
export const selectProfiles = (state) => state.outstaffing.profiles;
export const selectTags = (state) => state.outstaffing.tags;
export const selectCandidates = (state) => state.outstaffing.candidates;
export const selectTab = (state) => state.outstaffing.selectedTab;
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;