implement claim submit
This commit is contained in:
37
frontend/client-portal/src/store/claimSubmit.ts
Normal file
37
frontend/client-portal/src/store/claimSubmit.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
export type claimSubmitType = {
|
||||
id: number;
|
||||
fullName: string;
|
||||
memberId: string;
|
||||
limit: {
|
||||
current: number;
|
||||
total: number;
|
||||
percentage: number;
|
||||
};
|
||||
};
|
||||
|
||||
type initState = {
|
||||
data: claimSubmitType[];
|
||||
};
|
||||
|
||||
let initState: initState = {
|
||||
data: [],
|
||||
};
|
||||
|
||||
const claimSubmitSlice = createSlice({
|
||||
name: 'claimsubmit',
|
||||
initialState: initState,
|
||||
reducers: {
|
||||
patch(state, action) {
|
||||
state.data = action.payload;
|
||||
},
|
||||
dispatch(state) {
|
||||
state.data = [];
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const claimSubmitAction = claimSubmitSlice.actions;
|
||||
|
||||
export default claimSubmitSlice.reducer;
|
||||
12
frontend/client-portal/src/store/index.ts
Normal file
12
frontend/client-portal/src/store/index.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { configureStore } from '@reduxjs/toolkit';
|
||||
import claimSubmit from './claimSubmit';
|
||||
|
||||
const store = configureStore({
|
||||
reducer: {
|
||||
claims: claimSubmit,
|
||||
},
|
||||
});
|
||||
|
||||
export type RootState = ReturnType<typeof store.getState>;
|
||||
|
||||
export default store;
|
||||
Reference in New Issue
Block a user