refactor(server/marketplace): Refactor to use promise events

This commit is contained in:
Taso committed 2021-06-08 15:46:57 -04:00
1 parent 4afa9c691b
commit 3df2f88759
9 files changed
+160 -134

No files matched your search

@@ -51,21 +51,21 @@ export const ListingActions: React.FC<MarketplaceListing> = ({ children, ...list
};
const handleReportListing = () => {
fetchNui<MarketplaceActionResp>(MarketplaceEvents.DELETE_LISTING, listing).then(
({ err, errMsg }) => {
if (err) {
return addAlert({
message: t(errMsg),
type: 'error',
});
}
addAlert({
message: t('APPS_MARKETPLACE_REPORT_LISTING_SUCCESS'),
type: 'success',
fetchNui<MarketplaceActionResp>(MarketplaceEvents.REPORT_LISTING, {
listingId: listing.id,
}).then(({ err, errMsg }) => {
if (err) {
return addAlert({
message: t(errMsg),
type: 'error',
});
},
);
}
addAlert({
message: t('APPS_MARKETPLACE_REPORT_LISTING_SUCCESS'),
type: 'success',
});
});
};
const handleCall = () => {
@@ -56,7 +56,7 @@ export const ListingForm = () => {
}).then(({ err, errMsg }) => {
if (err) {
return addAlert({
message: t(errMsg),
message: t('errMsg'),
type: 'error',
});
}