file_table_reader/src/store/slices/uploadSlice.js
dmsanhrProject f7d59fc077 Init commit
2025-10-30 11:28:14 +07:00

32 lines
708 B
JavaScript

import { createSlice } from "@reduxjs/toolkit";
const initialState = {
file: null,
result: null,
validatedData: null,
};
const uploadSlice = createSlice({
name: "upload",
initialState,
reducers: {
setFile: (state, action) => {
state.file = action.payload;
},
setResult: (state, action) => {
state.result = action.payload;
},
setValidatedData: (state, action) => {
state.validatedData = action.payload;
},
reset: (state) => {
state.file = null;
state.result = null;
state.validatedData = null;
},
},
});
export const { setFile, setResult, setValidatedData, reset } = uploadSlice.actions;
export default uploadSlice.reducer;