1
1
/**
2
2
* Product Custom Relationships
3
3
*/
4
- import { Identifiable , Resource , ResourceList } from './core'
4
+ import { Identifiable , SimpleResourcePageResponse } from './core'
5
5
import {
6
6
CustomRelationship ,
7
7
CustomRelationshipsListResponse
@@ -17,22 +17,14 @@ export interface CustomRelationshipEntry {
17
17
slug : string
18
18
}
19
19
20
- export interface PcmRelatedProductResponse < T > extends ResourceList < T > {
21
- meta : {
22
- results : {
23
- total : number
24
- }
25
- }
26
- }
27
-
28
20
export interface NonAssociatedProductEntry extends Identifiable {
29
21
details : string
30
22
}
31
23
32
24
export interface ProductAssociationResponse {
33
25
meta : {
34
- associated_products : string [ ]
35
- products_not_associated : NonAssociatedProductEntry [ ]
26
+ associated_products ? : string [ ]
27
+ products_not_associated ? : NonAssociatedProductEntry [ ]
36
28
owner : 'organization' | 'store'
37
29
timestamps : {
38
30
created_at : string
@@ -61,8 +53,8 @@ export interface PcmCustomRelationshipEndpoint {
61
53
*/
62
54
AttachCustomRelationship (
63
55
productId : string ,
64
- body : CustomRelationshipEntry
65
- ) : Promise < Resource < CustomRelationship > >
56
+ body : CustomRelationshipEntry [ ]
57
+ ) : Promise < SimpleResourcePageResponse < CustomRelationship > >
66
58
67
59
/**
68
60
* Detach one or multiple custom relationships from a product
@@ -107,7 +99,7 @@ export interface PcmCustomRelationshipEndpoint {
107
99
GetProductsForCustomRelationship (
108
100
productId : string ,
109
101
customRelationshipSlug : string
110
- ) : Promise < PcmRelatedProductResponse < PcmProduct > >
102
+ ) : Promise < SimpleResourcePageResponse < PcmProduct > >
111
103
112
104
/**
113
105
* Get all IDs of a product's related products under a custom relationship
@@ -118,5 +110,5 @@ export interface PcmCustomRelationshipEndpoint {
118
110
GetProductIdsForCustomRelationship (
119
111
productId : string ,
120
112
customRelationshipSlug : string
121
- ) : Promise < PcmRelatedProductResponse < PcmProductEntry > >
113
+ ) : Promise < SimpleResourcePageResponse < PcmProductEntry > >
122
114
}
0 commit comments