mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
refactor(phone/marketplace): Refactor state management and fetching
This commit is contained in:
1 parent
2d1e192892
commit
4afa9c691b
12 files changed
+211
-87
No files matched your search
+24
-1
@@ -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;
|
||||
};
|
||||
Reference in new issue
Block a user