fix(dashboard): create variant remove inventory quantity (#8129)

This commit is contained in:
Frane Polić
2024-07-15 17:44:09 +02:00
committed by GitHub
parent 00c7900337
commit 43eb38c8cb
@@ -27,7 +27,6 @@ const CreateProductVariantSchema = z.object({
ean: z.string().optional(), ean: z.string().optional(),
upc: z.string().optional(), upc: z.string().optional(),
barcode: z.string().optional(), barcode: z.string().optional(),
inventory_quantity: optionalInt,
manage_inventory: z.boolean(), manage_inventory: z.boolean(),
allow_backorder: z.boolean(), allow_backorder: z.boolean(),
weight: optionalInt, weight: optionalInt,
@@ -49,7 +48,6 @@ export const CreateProductVariantForm = ({
const form = useForm<z.infer<typeof CreateProductVariantSchema>>({ const form = useForm<z.infer<typeof CreateProductVariantSchema>>({
defaultValues: { defaultValues: {
inventory_quantity: 0,
manage_inventory: true, manage_inventory: true,
allow_backorder: false, allow_backorder: false,
options: {}, options: {},
@@ -79,7 +77,6 @@ export const CreateProductVariantForm = ({
height, height,
width, width,
length, length,
inventory_quantity,
allow_backorder, allow_backorder,
manage_inventory, manage_inventory,
sku, sku,
@@ -100,7 +97,6 @@ export const CreateProductVariantForm = ({
ean, ean,
upc, upc,
barcode, barcode,
inventory_quantity: parseNumber(inventory_quantity),
allow_backorder, allow_backorder,
manage_inventory, manage_inventory,
} }
@@ -247,23 +243,6 @@ export const CreateProductVariantForm = ({
) )
}} }}
/> />
<Form.Field
control={form.control}
name="inventory_quantity"
render={({ field }) => {
return (
<Form.Item>
<Form.Label>
{t("fields.inventoryQuantity")}
</Form.Label>
<Form.Control>
<Input type="number" {...field} />
</Form.Control>
<Form.ErrorMessage />
</Form.Item>
)
}}
/>
</div> </div>
<Form.Field <Form.Field
control={form.control} control={form.control}