feat: reset plaid lanch link token

This commit is contained in:
Ahmed Bouhuolia
2024-02-04 19:59:04 +02:00
parent 299a943153
commit 6d888060d3
5 changed files with 73 additions and 59 deletions

View File

@@ -1,4 +1,8 @@
import { getPlaidToken, setPlaidId } from '@/store/banking/banking.reducer';
import {
getPlaidToken,
setPlaidId,
resetPlaidId,
} from '@/store/banking/banking.reducer';
import { useCallback } from 'react';
import { useDispatch, useSelector } from 'react-redux';
@@ -18,3 +22,11 @@ export const useGetBankingPlaidToken = () => {
return plaidToken;
};
export const useResetBankingPlaidToken = () => {
const dispatch = useDispatch();
return useCallback(() => {
dispatch(resetPlaidId());
}, [dispatch]);
};