fix: cart connect to backend (#39)
Release package / release (push) Failing after 8m34s

Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com>
Reviewed-on: #39
This commit was merged in pull request #39.
This commit is contained in:
2026-05-13 08:56:58 +00:00
parent ae8134fd64
commit 877c7be84b
7 changed files with 183 additions and 288 deletions
+4 -4
View File
@@ -9,8 +9,8 @@ import { useManager } from "@/lib/manager-context";
import { MenuItemEntity } from "@/lib/types";
import { useState } from "react";
const formatPrice = (value: number) =>
value.toLocaleString("vi-VN", { style: "currency", currency: "VND" });
export const formatPrice = (value?: number) =>
(value ?? 0).toLocaleString("vi-VN", { style: "currency", currency: "VND" });
export default function PaymentPage() {
const {
@@ -42,7 +42,7 @@ export default function PaymentPage() {
</h1>
</div>
{items.length === 0 ? (
{items?.length === 0 ? (
<div className="px-4 py-10 text-center text-(--color-text-muted)">
Chưa sản phẩm nào trong giỏ hàng.
</div>
@@ -72,7 +72,7 @@ export default function PaymentPage() {
</tr>
</thead>
<tbody>
{items.map(
{items?.map(
({
productId: id,
priceAtTimeOfAdding: price,