79253497

Date: 2024-12-05 05:34:18
Score: 1
Natty:
Report link

Found the answer, on my types it should be z.number() instead of z.string() for the productId and variantId

import * as z from 'zod'

export const createOrderSchema = z.object({
  total: z.number(),
  status: z.string(),
  paymentIntentId: z.string(),
  products: z.array(
    z.object({
      quantity: z.number(),
      productId: z.number(),
      variantId: z.number(),
    }),
  ),
})
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Karl Cusi