ordering-ui-react-native 0.16.62-release → 0.16.63-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -69,23 +69,25 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
69
69
|
const _orders = customArray || values || []
|
|
70
70
|
const uniqueOrders: any = []
|
|
71
71
|
|
|
72
|
-
|
|
73
72
|
useEffect(() => {
|
|
74
73
|
if (loading || error) return
|
|
75
74
|
const ordersReduced = _orders.map((order: any) => order?.cart_group_id
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
75
|
+
? _orders
|
|
76
|
+
.filter((_order: any) => _order?.cart_group_id === order?.cart_group_id)
|
|
77
|
+
.map((_o: any, _: any, _ordersList: any) => {
|
|
78
|
+
const obj = {
|
|
79
|
+
..._o,
|
|
80
|
+
id: _ordersList.map(o => o.id),
|
|
81
|
+
review: _o.review,
|
|
82
|
+
user_review: _o.user_review,
|
|
83
|
+
total: _ordersList.reduce((acc: any, o: any) => acc + o.summary.total, 0),
|
|
84
|
+
business: _ordersList.map((o: any) => o.business),
|
|
85
|
+
business_id: _ordersList.map((o: any) => o.business_id),
|
|
86
|
+
products: _ordersList.map((o: any) => o.products)
|
|
87
|
+
}
|
|
88
|
+
return obj
|
|
89
|
+
}).find((o: any) => o)
|
|
90
|
+
: order)
|
|
89
91
|
const orders = ordersReduced?.filter((order: any) => {
|
|
90
92
|
if (!order?.cart_group_id) return true
|
|
91
93
|
const isDuplicate = uniqueOrders.includes(order?.cart_group_id)
|