Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com> Reviewed-on: #40
This commit was merged in pull request #40.
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
|
||||
# Cài đặt pnpm
|
||||
RUN npm install -g pnpm
|
||||
RUN npm install -g pnpm@10.9.0
|
||||
|
||||
# Copy file định nghĩa package để tận dụng cache của Docker
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
@@ -97,7 +97,6 @@ export function CartProvider({ children }: { children: React.ReactNode }) {
|
||||
const { data, loading, error } = useQuery<getCartQuery>(GET_CART_ITEMS, {
|
||||
client: cartClient,
|
||||
variables: { cartId },
|
||||
skip: !cartId,
|
||||
});
|
||||
|
||||
const [addMenuItem] = useMutation<addMenuItemMutation>(ADD_ITEM, {
|
||||
@@ -129,7 +128,7 @@ export function CartProvider({ children }: { children: React.ReactNode }) {
|
||||
const localCartId = localStorage.getItem(CART_ID);
|
||||
if (localCartId) setCartId(localCartId);
|
||||
}
|
||||
}, [eateryData, createCart, data, loading]);
|
||||
}, [eateryData, createCart, data, loading, error]);
|
||||
|
||||
useEffect(() => {
|
||||
if (data?.getCart) setCart(data.getCart);
|
||||
|
||||
Reference in New Issue
Block a user