Skip to content

Commit ee0ed69

Browse files
committed
Bump version and add topics to products and discounts
1 parent e682e4b commit ee0ed69

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@crystallize/js-api-client",
33
"license": "MIT",
4-
"version": "0.7.1",
4+
"version": "0.7.2",
55
"author": "Crystallize <[email protected]> (https://crystallize.com)",
66
"contributors": [
77
"Sébastien Morel <[email protected]>"

src/core/order.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export function createOrderFetcher(apiClient: ClientInterface) {
9292
const response = await orderApi(jsonToGraphQLQuery({ query }));
9393
return {
9494
pageInfo: response.orders.getAll.pageInfo,
95-
orders: response.orders.getAll.edges.map((edge: any) => edge.node),
95+
orders: response.orders.getAll?.edges?.map((edge: any) => edge.node) || [],
9696
};
9797
};
9898

src/types/product.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export interface Item {
33
name?: string;
44
path?: string;
55
externalReference?: string;
6+
topics?: Topic[];
67
}
78

89
export interface Product extends Item {
@@ -120,3 +121,28 @@ export interface ImageVariant {
120121
height?: number;
121122
size?: number;
122123
}
124+
125+
export interface Topic {
126+
id: string;
127+
name: string;
128+
path: string;
129+
language?: string;
130+
parentId?: string;
131+
parent: Topic;
132+
children: Topic[];
133+
childCount: number;
134+
createdAt?: Date;
135+
items: {
136+
edges: {
137+
node: Item;
138+
cursor: string;
139+
};
140+
pageInfo: {
141+
hasNextPage: boolean;
142+
hasPreviousPage: boolean;
143+
startCursor: string;
144+
endCursor: string;
145+
totalNodes: number;
146+
};
147+
};
148+
}

0 commit comments

Comments
 (0)