update marketplace enums

This commit is contained in:
Christopher committed 2021-03-25 13:07:07 +01:00
1 parent 5ce6cf2d4a
commit a6f98d7ac0
3 files changed
+6 -4

No files matched your search

@@ -4,6 +4,7 @@ import { useListing } from './useListing';
import { useSetRecoilState } from 'recoil';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
import { MarketplaceEvents } from '../../../../../typings/marketplace';
export const useSelloutService = () => {
const setSellout = useSetRecoilState(selloutState.listing);
@@ -17,7 +18,7 @@ export const useSelloutService = () => {
});
};
useNuiEvent('SELLOUT', 'setAlert', handleAddAlert);
useNuiEvent('SELLOUT', 'setListings', setSellout);
useNuiEvent('SELLOUT', MarketplaceEvents.SEND_ALERT, handleAddAlert);
useNuiEvent('SELLOUT', MarketplaceEvents.SEND_LISTING, setSellout);
return useListing();
};
+2 -2
View File
@@ -3,7 +3,7 @@ import { IAlertProps } from '../../typings/alerts';
import { sendMarketplaceEvent } from '../utils/messages';
onNet(MarketplaceEvents.SEND_LISTING, (listings: MarketplaceListing[]) => {
sendMarketplaceEvent('setListings', listings);
sendMarketplaceEvent(MarketplaceEvents.SEND_LISTING, listings);
});
RegisterNuiCallbackType(MarketplaceEvents.ADD_LISTING);
@@ -33,5 +33,5 @@ onNet(MarketplaceEvents.DELETE_LISTING_SUCCESS, () => {
});
onNet(MarketplaceEvents.ACTION_RESULT, (alert: IAlertProps) => {
sendMarketplaceEvent('setAlert', alert);
sendMarketplaceEvent(MarketplaceEvents.SEND_ALERT, alert);
});
+1
View File
@@ -20,4 +20,5 @@ export enum MarketplaceEvents {
REPORT_LISTING = 'npwd:reportListing',
REPORT_LISTING_SUCCESS = 'npwd:reportListingSuccess',
REPORT_LISTING_SUCESS = 'npwd:reportListingFailed',
SEND_ALERT = 'nwpd:sendListingAlert',
}