From a6f98d7ac00d378b37e9aeabd8dfe4ed41eef6ec Mon Sep 17 00:00:00 2001 From: Christopher Date: Thu, 25 Mar 2021 13:07:07 +0100 Subject: [PATCH] update marketplace enums --- phone/src/apps/sellout/hooks/useSelloutService.ts | 5 +++-- resources/client/cl_sellout.ts | 4 ++-- typings/marketplace.ts | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/phone/src/apps/sellout/hooks/useSelloutService.ts b/phone/src/apps/sellout/hooks/useSelloutService.ts index b5cbc0b..bd25ae8 100644 --- a/phone/src/apps/sellout/hooks/useSelloutService.ts +++ b/phone/src/apps/sellout/hooks/useSelloutService.ts @@ -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(); }; diff --git a/resources/client/cl_sellout.ts b/resources/client/cl_sellout.ts index 1699827..964485d 100644 --- a/resources/client/cl_sellout.ts +++ b/resources/client/cl_sellout.ts @@ -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); }); diff --git a/typings/marketplace.ts b/typings/marketplace.ts index 64c02ec..94099a4 100644 --- a/typings/marketplace.ts +++ b/typings/marketplace.ts @@ -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', }