fix: serialize prisma decimal to string for client component & add VPS analytics
This commit is contained in:
@@ -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