-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroutes.ts
More file actions
58 lines (55 loc) · 1.59 KB
/
Copy pathroutes.ts
File metadata and controls
58 lines (55 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { registerRouteComponent } from '@vendure/admin-ui/core';
import { AllProductReviewsListComponent } from './components/all-product-reviews-list/all-product-reviews-list.component';
import { ProductReviewDetailComponent } from './components/product-review-detail/product-review-detail.component';
import { graphql } from './gql';
export const GET_REVIEW_DETAIL = graphql(`
query GetReviewDetail($id: ID!) {
productReview(id: $id) {
...ProductReview
product {
id
name
featuredAsset {
id
preview
}
}
productVariant {
id
name
featuredAsset {
id
preview
}
}
}
}
`);
export default [
registerRouteComponent({
path: '',
component: AllProductReviewsListComponent,
breadcrumb: [
{
label: 'Product reviews',
link: ['/extensions', 'product-reviews'],
},
],
}),
registerRouteComponent({
path: ':id',
component: ProductReviewDetailComponent,
query: GET_REVIEW_DETAIL,
entityKey: 'productReview',
getBreadcrumbs: entity => [
{
label: 'Product reviews',
link: ['/extensions', 'product-reviews'],
},
{
label: `#${entity?.id} (${entity?.product.name})`,
link: [],
},
],
}),
];