ZH
测试版翻译

@core / kit-store

1.0.1 ▾
已验证MIT
GitHub

Next.js 网店套件:商品目录、购物车、Stripe 结账、订单、配送、优惠券、真实评价和账户

代码27 个文件上下文约 1024 个 token扫描通过

应用 .genpmignore 后将被注入的确切目录树。固定于

src/app/(store)/orders/[number]/page.tsx只读 · 6a45dae
// Pedido de cliente: accesible para su dueño con sesión o con el enlace firmado del email (`?token=`).
import type { Metadata } from 'next';
import { notFound } from 'next/navigation';
import { getOrderForCustomer } from '@/lib/orders';
import { OrderSummary } from '../../_components/order-summary';
import '../../_components/store.css';
import { currentUserId, one } from '../../_lib/store';

export const dynamic = 'force-dynamic';
export const metadata: Metadata = { title: 'Your order', robots: { index: false, follow: false } };

export default async function OrderPage({ params, searchParams }: { params: Promise<{ number: string }>; searchParams: Promise<Record<string, string | string[] | undefined>> }) {
  const { number } = await params;
  const order = await getOrderForCustomer(number, { userId: await currentUserId(), token: one((await searchParams).token) ?? null });
  if (!order) notFound(); // también si existe pero no es tuyo
  return (
    <main className="blk store">
      <OrderSummary order={order} />
    </main>
  );
}

举报 @core/kit-store

使用 GitHub 登录后才能举报包。