Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix ReactJS part

Pacu270425a552933
diff --git a/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx b/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx
index e3f76787b2..41c2734f8b 100644
--- a/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx
+++ b/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx
@@ -83,19 +83,15 @@ interface OrderDetailsPageProps {
email: string;
};
}>;
- lines: {
- edges: Array<{
- node: {
- id: string;
- productName: string;
- productSku: string;
- thumbnailUrl: string;
- unitPrice: TaxedMoneyType;
- quantity: number;
- quantityFulfilled: number;
- };
- }>;
- };
+ lines: Array<{
+ id: string;
+ productName: string;
+ productSku: string;
+ thumbnailUrl: string;
+ unitPrice: TaxedMoneyType;
+ quantity: number;
+ quantityFulfilled: number;
+ }>;
number: string;
paymentStatus: string;
shippingAddress?: AddressType;
@@ -288,9 +284,9 @@ class OrderDetailsPageComponent extends React.Component<
openedShippingMethodEditDialog
} = this.state;
const isDraft = order ? order.status === OrderStatus.DRAFT : false;
- const unfulfilled = maybe(() => order.lines.edges, [])
- .map(edge => edge.node)
- .filter(line => line.quantityFulfilled < line.quantity);
+ const unfulfilled = maybe(() => order.lines, []).filter(
+ line => line.quantityFulfilled < line.quantity
+ );
return (
<Container width="md">
<PageHeader
@@ -321,7 +317,7 @@ class OrderDetailsPageComponent extends React.Component<
authorized={maybe(() => order.totalAuthorized)}
paid={maybe(() => order.totalCaptured)}
paymentStatus={maybe(() => order.paymentStatus)}
- lines={maybe(() => order.lines.edges.map(edge => edge.node))}
+ lines={maybe(() => order.lines)}
shippingMethodName={maybe(() => order.shippingMethodName)}
shippingPrice={maybe(() => order.shippingPrice)}
status={maybe(() => order.status)}
diff --git a/saleor/static/dashboard-next/orders/views/OrderDetails.tsx b/saleor/static/dashboard-next/orders/views/OrderDetails.tsx
index a7df7790d8..c28aa6aafe 100644
--- a/saleor/static/dashboard-next/orders/views/OrderDetails.tsx
+++ b/saleor/static/dashboard-next/orders/views/OrderDetails.tsx
@@ -262,8 +262,7 @@ export const OrderDetails: React.StatelessComponent<OrderDetailsProps> = ({
orderCreateFulfillment.mutate({
input: {
...variables,
- lines: maybe(() => order.lines.edges, [])
- .map(edge => edge.node)
+ lines: maybe(() => order.lines, [])
.filter(
line =>
line.quantityFulfilled <