Tweak/marketplace additions (#137)

Checks for being the OP of the listing. Calling, Message, Delete and Report. 

Updates to Locale is needed.
This commit is contained in:
Christopher Gjelten authored and GitHub committed 2021-03-07 16:30:58 +01:00
1 parent 0203ebbe51
commit 6b6080c4b2
13 files changed
+277 -47

No files matched your search

+17 -3
View File
@@ -13,17 +13,31 @@ onNet(events.SELLOUT_SEND_LISTING, (listing: MarketplaceListing) => {
});
RegisterNuiCallbackType(events.SELLOUT_ADD_LISTING);
on(`__cfx_nui:${events.SELLOUT_ADD_LISTING}`, (data: MarketplaceListing) => {
on(`__cfx_nui:${events.SELLOUT_ADD_LISTING}`, (data: MarketplaceListing, cb: Function) => {
emitNet(events.SELLOUT_ADD_LISTING, data);
cb();
});
// this will be triggerd when
// the adding of a new listing is successfully
RegisterNuiCallbackType(events.SELLOUT_DELETE_LISTING);
on(`__cfx_nui:${events.SELLOUT_DELETE_LISTING}`, (data: MarketplaceListing, cb: Function) => {
emitNet(events.SELLOUT_DELETE_LISTING, data.id);
cb();
});
RegisterNuiCallbackType(events.SELLOUT_REPORT_LISTING);
on(`__cfx_nui:${events.SELLOUT_REPORT_LISTING}`, (data: MarketplaceListing, cb: Function) => {
emitNet(events.SELLOUT_SEND_LISTING, data);
cb();
});
onNet(events.SELLOUT_ADD_LISTING_SUCCESS, () => {
emitNet(events.SELLOUT_FETCH_LISTING);
});
onNet(events.SELLOUT_DELETE_LISTING_SUCCESS, () => {
emitNet(events.SELLOUT_FETCH_LISTING);
});
onNet(events.SELLOUT_ACTION_RESULT, (alert: IAlertProps) => {
SendNuiMessage(
JSON.stringify({