fix: serialize prisma decimal to string for client component & add VPS analytics
This commit is contained in:
@@ -48,6 +48,10 @@ export default async function LocaleLayout({
|
||||
|
||||
return (
|
||||
<html lang={locale} className={`${cormorant.variable} ${jakarta.variable} h-full`}>
|
||||
<head>
|
||||
{/* VPS Panel Analytics */}
|
||||
<script defer src="https://panel.ayris.tech/api/analytics/script" data-domain="http://menu.moybeachakyaka.com"></script>
|
||||
</head>
|
||||
<body className="min-h-full flex flex-col antialiased" suppressHydrationWarning>
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
{children}
|
||||
|
||||
@@ -30,9 +30,22 @@ export default async function ProductsPage() {
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
{categories.map((category) => (
|
||||
<CategoryAccordion key={category.id} category={category} defaultOpen={false} />
|
||||
))}
|
||||
{categories.map((category) => {
|
||||
const serializedCategory = {
|
||||
...category,
|
||||
products: category.products.map(p => ({
|
||||
...p,
|
||||
price: p.price ? p.price.toString() : '0'
|
||||
}))
|
||||
}
|
||||
return (
|
||||
<CategoryAccordion
|
||||
key={category.id}
|
||||
category={serializedCategory as any}
|
||||
defaultOpen={false}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user