feat: Add support for setting sales channel when creating a product (#6986)

This commit is contained in:
Stevche Radevski
2024-04-07 13:45:47 +02:00
committed by GitHub
parent d1728990e9
commit 44bcde92c8
13 changed files with 126 additions and 168 deletions
@@ -202,6 +202,7 @@ export const AdminCreateProduct = z
tags: z.array(AdminUpdateProductTag).optional(),
options: z.array(AdminCreateProductOption).optional(),
variants: z.array(AdminCreateProductVariant).optional(),
sales_channels: z.array(z.object({ id: z.string() })).optional(),
weight: z.number().optional(),
length: z.number().optional(),
height: z.number().optional(),
@@ -231,12 +232,3 @@ export const AdminUpdateProduct = AdminCreateProduct.omit({ is_giftcard: true })
// @ValidateNested({ each: true })
// @IsArray()
// categories?: ProductProductCategoryReq[]
// TODO: Deal with in next iteration
// @FeatureFlagDecorators(SalesChannelFeatureFlag.key, [
// IsOptional(),
// Type(() => ProductSalesChannelReq),
// ValidateNested({ each: true }),
// IsArray(),
// ])
// sales_channels?: ProductSalesChannelReq[]