feat(bank): update usage of enums

This commit is contained in:
Christopher committed 2021-03-22 23:05:39 +01:00
1 parent b42ee97450
commit 5654e1f46f
2 files changed
+5 -4

No files matched your search

+3 -2
View File
@@ -6,6 +6,7 @@ import { useSetRecoilState } from 'recoil';
import { useBankNotification } from './useBankNotification';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
import { BankEvents } from '../../../../../typings/bank';
export const useBankService = () => {
const setTransaction = useSetRecoilState(bankState.transactions);
@@ -21,8 +22,8 @@ export const useBankService = () => {
});
};
useNuiEvent('BANK', 'setTransaction', setTransaction);
useNuiEvent('BANK', 'setCredentials', setCredentials);
useNuiEvent('BANK', BankEvents.SEND_TRANSFERS, setTransaction);
useNuiEvent('BANK', BankEvents.SEND_CREDENTIALS, setCredentials);
useNuiEvent('BANK', 'setAlert', handleAddAlert);
useNuiEvent('BANK', 'setNotification', setNotification);
return { useTransactions, useCredentials, useBankNotification };
+2 -2
View File
@@ -5,7 +5,7 @@ onNet(BankEvents.SEND_TRANSFERS, (transfer: any) => {
SendNuiMessage(
JSON.stringify({
app: 'BANK',
method: 'setTransaction',
method: BankEvents.SEND_TRANSFERS,
data: transfer,
}),
);
@@ -15,7 +15,7 @@ onNet(BankEvents.SEND_CREDENTIALS, (credentials: any) => {
SendNuiMessage(
JSON.stringify({
app: 'BANK',
method: 'setCredentials',
method: BankEvents.SEND_CREDENTIALS,
data: credentials,
}),
);