tweak(resources): use 'custom appMessageEvent'

This commit is contained in:
Christopher committed 2021-03-15 10:53:02 +01:00
1 parent 5c9f36f754
commit 458839488e
4 files changed
+17 -95

No files matched your search

+3 -14
View File
@@ -1,15 +1,10 @@
import events from '../utils/events';
import { MarketplaceListing } from '../../typings/marketplace';
import { IAlertProps } from '../../typings/alerts';
import { sendMarketplaceEvent } from '../utils/messages';
onNet(events.SELLOUT_SEND_LISTING, (listing: MarketplaceListing) => {
SendNuiMessage(
JSON.stringify({
app: 'SELLOUT',
method: 'setListings',
data: listing,
}),
);
sendMarketplaceEvent('setListing', listing);
});
RegisterNuiCallbackType(events.SELLOUT_ADD_LISTING);
@@ -39,11 +34,5 @@ onNet(events.SELLOUT_DELETE_LISTING_SUCCESS, () => {
});
onNet(events.SELLOUT_ACTION_RESULT, (alert: IAlertProps) => {
SendNuiMessage(
JSON.stringify({
app: 'SELLOUT',
method: 'setAlert',
data: alert,
}),
);
sendMarketplaceEvent('setAlert', alert);
});