mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
feat: add connect to bank dialog
This commit is contained in:
20
packages/webapp/src/store/banking/banking.reducer.ts
Normal file
20
packages/webapp/src/store/banking/banking.reducer.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { PayloadAction, createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
interface StorePlaidState {
|
||||
plaidToken: string;
|
||||
}
|
||||
|
||||
export const PlaidSlice = createSlice({
|
||||
name: 'plaid',
|
||||
initialState: {
|
||||
plaidToken: '',
|
||||
} as StorePlaidState,
|
||||
reducers: {
|
||||
setPlaidId: (state: StorePlaidState, action: PayloadAction<string>) => {
|
||||
state.plaidToken = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setPlaidId } = PlaidSlice.actions;
|
||||
export const getPlaidToken = (state: any) => state.plaid.plaidToken;
|
||||
@@ -37,6 +37,7 @@ import creditNotes from './CreditNote/creditNote.reducer';
|
||||
import vendorCredit from './VendorCredit/VendorCredit.reducer';
|
||||
import warehouseTransfers from './WarehouseTransfer/warehouseTransfer.reducer';
|
||||
import projects from './Project/projects.reducer';
|
||||
import { PlaidSlice } from './banking/banking.reducer';
|
||||
|
||||
const appReducer = combineReducers({
|
||||
authentication,
|
||||
@@ -73,6 +74,7 @@ const appReducer = combineReducers({
|
||||
vendorCredit,
|
||||
warehouseTransfers,
|
||||
projects,
|
||||
plaid: PlaidSlice.reducer,
|
||||
});
|
||||
|
||||
// Reset the state of a redux store
|
||||
|
||||
Reference in New Issue
Block a user