@akinon/pz-multi-basket 1.44.0 → 1.45.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @akinon/pz-multi-basket
2
2
 
3
+ ## 1.45.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2ab6e08: ZERO-2841: Update getBasketDetail query
8
+
3
9
  ## 1.44.0
4
10
 
5
11
  ## 1.43.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/pz-multi-basket",
3
- "version": "1.44.0",
3
+ "version": "1.45.0",
4
4
  "license": "MIT",
5
5
  "main": "./src/index.ts",
6
6
  "module": "./src/index.ts",
@@ -4,7 +4,7 @@ import React, { useEffect, useState } from 'react';
4
4
  import {
5
5
  useGetBasketQuery,
6
6
  useGetAllBasketsQuery,
7
- useGetBasketDetailMutation,
7
+ useLazyGetBasketDetailQuery,
8
8
  useRemoveBasketMutation,
9
9
  useSelectMainBasketMutation
10
10
  } from '@akinon/next/data/client/basket';
@@ -21,8 +21,8 @@ export const MultiBasket = (props: Props) => {
21
21
  const { data: basketData } = useGetBasketQuery();
22
22
  const { data: allBaskets, isSuccess: isAllBasketsSuccess } =
23
23
  useGetAllBasketsQuery();
24
+ const [getBasketDetail] = useLazyGetBasketDetailQuery();
24
25
  const { BasketItem } = props;
25
- const [getBasketDetail] = useGetBasketDetailMutation();
26
26
  const [removeBasket] = useRemoveBasketMutation();
27
27
  const [selectMainBasket] = useSelectMainBasketMutation();
28
28
  const [detailedBaskets, setDetailedBaskets] = useState<any[]>([]);
@@ -53,10 +53,10 @@ export const MultiBasket = (props: Props) => {
53
53
 
54
54
  return (
55
55
  <>
56
- {isAllBasketsSuccess && (
56
+ {detailedBaskets.length > 0 && (
57
57
  <>
58
- {detailedBaskets.map(({ basket }) => (
59
- <div key={basket.pk}>
58
+ {detailedBaskets.map((basket) => (
59
+ <div key={basket?.pk}>
60
60
  {basket?.basketitem_set?.length > 0 && (
61
61
  <div className="border mb-4">
62
62
  <div