refactor(phone/marketplace): Refactor state management and fetching

This commit is contained in:
Taso committed 2021-06-08 15:46:39 -04:00
1 parent 2d1e192892
commit 4afa9c691b
12 files changed
+211 -87

No files matched your search

+24 -1
View File
@@ -1,14 +1,22 @@
export interface MarketplaceListing {
export interface MarketplaceListing extends MarketplaceListingBase {
id: number;
identifier?: string;
username: string;
name: string;
number: string;
}
export interface MarketplaceListingBase {
title: string;
url: string;
description: string;
}
export interface MarketplaceActionResp {
err: boolean;
errMsg?: string;
}
export enum MarketplaceEvents {
ADD_LISTING = 'npwd:addListing',
ADD_LISTING_SUCCESS = 'npwd:addListingSuccess',
@@ -21,4 +29,19 @@ export enum MarketplaceEvents {
REPORT_LISTING_SUCCESS = 'npwd:reportListingSuccess',
REPORT_LISTING_SUCESS = 'npwd:reportListingFailed',
SEND_ALERT = 'nwpd:sendListingAlert',
BROADCAST_EVENT = 'npwd:sendMarketplaceBroadcast',
}
export interface MarketplaceDeleteDTO {
id: number;
}
export type MarketPlaceBroadcastData =
| {
type: 'ADD';
listing: MarketplaceListing;
}
| {
type: 'DELETE';
listing: MarketplaceDeleteDTO;
};