Move SegmentResponse type to types.ts to be able to reuse it
[MAILPOET-5407]
This commit is contained in:
committed by
Aschepikov
parent
75ed1681e8
commit
4583b80fa6
@@ -5,6 +5,7 @@ import classnames from 'classnames';
|
|||||||
import { escapeHTML, escapeAttribute } from '@wordpress/escape-html';
|
import { escapeHTML, escapeAttribute } from '@wordpress/escape-html';
|
||||||
|
|
||||||
import { Listing } from 'listing/listing.jsx';
|
import { Listing } from 'listing/listing.jsx';
|
||||||
|
import { SegmentResponse } from 'segments/types';
|
||||||
import { ListingsEngagementScore } from '../subscribers/listings_engagement_score';
|
import { ListingsEngagementScore } from '../subscribers/listings_engagement_score';
|
||||||
|
|
||||||
type Segment = {
|
type Segment = {
|
||||||
@@ -24,18 +25,6 @@ type Segment = {
|
|||||||
subscribers_url: string;
|
subscribers_url: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type SegmentResponse = {
|
|
||||||
meta: {
|
|
||||||
count: string;
|
|
||||||
};
|
|
||||||
data: {
|
|
||||||
name: string;
|
|
||||||
};
|
|
||||||
errors: {
|
|
||||||
message: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
|
|
||||||
const isWPUsersSegment = (segment: Segment) => segment.type === 'wp_users';
|
const isWPUsersSegment = (segment: Segment) => segment.type === 'wp_users';
|
||||||
const isWooCommerceCustomersSegment = (segment: Segment) =>
|
const isWooCommerceCustomersSegment = (segment: Segment) =>
|
||||||
segment.type === 'woocommerce_users';
|
segment.type === 'woocommerce_users';
|
||||||
|
@@ -1 +1,13 @@
|
|||||||
export * from './dynamic/types';
|
export * from './dynamic/types';
|
||||||
|
|
||||||
|
export type SegmentResponse = {
|
||||||
|
meta: {
|
||||||
|
count: string;
|
||||||
|
};
|
||||||
|
data: {
|
||||||
|
name: string;
|
||||||
|
};
|
||||||
|
errors: {
|
||||||
|
message: string;
|
||||||
|
}[];
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user