mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
1 parent
baf6dedb6f
commit
a88286f97a
23 files changed
+85
-52
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import { MarketplaceEvents, MarketplaceListing } from '../../typings/marketplace';
|
||||
import { IAlertProps } from '../../typings/alerts';
|
||||
import { sendMarketplaceEvent } from '../utils/messages';
|
||||
|
||||
onNet(MarketplaceEvents.SEND_LISTING, (listings: MarketplaceListing[]) => {
|
||||
sendMarketplaceEvent(MarketplaceEvents.SEND_LISTING, listings);
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(MarketplaceEvents.ADD_LISTING);
|
||||
on(`__cfx_nui:${MarketplaceEvents.ADD_LISTING}`, (data: MarketplaceListing, cb: Function) => {
|
||||
emitNet(MarketplaceEvents.ADD_LISTING, data);
|
||||
cb();
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(MarketplaceEvents.DELETE_LISTING);
|
||||
on(`__cfx_nui:${MarketplaceEvents.DELETE_LISTING}`, (data: MarketplaceListing, cb: Function) => {
|
||||
emitNet(MarketplaceEvents.DELETE_LISTING, data.id);
|
||||
cb();
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(MarketplaceEvents.REPORT_LISTING);
|
||||
on(`__cfx_nui:${MarketplaceEvents.REPORT_LISTING}`, (data: MarketplaceListing, cb: Function) => {
|
||||
emitNet(MarketplaceEvents.REPORT_LISTING, data);
|
||||
cb();
|
||||
});
|
||||
|
||||
onNet(MarketplaceEvents.ADD_LISTING_SUCCESS, () => {
|
||||
emitNet(MarketplaceEvents.FETCH_LISTING);
|
||||
});
|
||||
|
||||
onNet(MarketplaceEvents.DELETE_LISTING_SUCCESS, () => {
|
||||
emitNet(MarketplaceEvents.FETCH_LISTING);
|
||||
});
|
||||
|
||||
onNet(MarketplaceEvents.ACTION_RESULT, (alert: IAlertProps) => {
|
||||
sendMarketplaceEvent(MarketplaceEvents.SEND_ALERT, alert);
|
||||
});
|
||||
Reference in new issue
Block a user