2021-12-07 10:58:19 +03:00
|
|
|
import { createSlice } from '@reduxjs/toolkit';
|
|
|
|
|
|
|
|
const initialState = {
|
|
|
|
dateSelected: '',
|
2022-12-26 15:12:01 +03:00
|
|
|
reportDate: ''
|
2021-12-07 10:58:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
export const reportSlice = createSlice({
|
|
|
|
name: 'report',
|
|
|
|
initialState,
|
|
|
|
reducers: {
|
|
|
|
dateSelected: (state, action) => {
|
|
|
|
state.dateSelected = action.payload;
|
|
|
|
},
|
2022-12-26 15:12:01 +03:00
|
|
|
setReportDate: (state, action) => {
|
|
|
|
state.reportDate = action.payload;
|
|
|
|
},
|
2021-12-07 10:58:19 +03:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2022-12-26 15:12:01 +03:00
|
|
|
export const { dateSelected, setReportDate} = reportSlice.actions;
|
2021-12-07 10:58:19 +03:00
|
|
|
|
|
|
|
export const selectDate = (state) => state.report.dateSelected;
|
|
|
|
|
2022-12-26 15:12:01 +03:00
|
|
|
export const getReportDate = (state) => state.report.reportDate;
|
|
|
|
|
2021-12-07 10:58:19 +03:00
|
|
|
export default reportSlice.reducer;
|