Move SegmentResponse type to types.ts to be able to reuse it

[MAILPOET-5407]
This commit is contained in:
Rodrigo Primo
2023-06-15 16:28:28 -03:00
committed by Aschepikov
parent 75ed1681e8
commit 4583b80fa6
2 changed files with 13 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ import classnames from 'classnames';
import { escapeHTML, escapeAttribute } from '@wordpress/escape-html';
import { Listing } from 'listing/listing.jsx';
import { SegmentResponse } from 'segments/types';
import { ListingsEngagementScore } from '../subscribers/listings_engagement_score';
type Segment = {
@@ -24,18 +25,6 @@ type Segment = {
subscribers_url: string;
};
type SegmentResponse = {
meta: {
count: string;
};
data: {
name: string;
};
errors: {
message: string;
}[];
};
const isWPUsersSegment = (segment: Segment) => segment.type === 'wp_users';
const isWooCommerceCustomersSegment = (segment: Segment) =>
segment.type === 'woocommerce_users';

View File

@@ -1 +1,13 @@
export * from './dynamic/types';
export type SegmentResponse = {
meta: {
count: string;
};
data: {
name: string;
};
errors: {
message: string;
}[];
};