fix(medusa): fix update promotion's request type (#8966)

Fix the validator of the update promotion API route to match the update workflow input's type.
This commit is contained in:
Shahed Nasser
2024-09-03 18:08:22 +03:00
committed by GitHub
parent 58f297cc75
commit 423583e06c
3 changed files with 1 additions and 23 deletions
@@ -132,8 +132,6 @@ export const AdminUpdateApplicationMethod = z
type: z.nativeEnum(ApplicationMethodType).optional(),
target_type: z.nativeEnum(ApplicationMethodTargetType).optional(),
allocation: z.nativeEnum(ApplicationMethodAllocation).optional(),
target_rules: z.array(AdminCreatePromotionRule).optional(),
buy_rules: z.array(AdminCreatePromotionRule).optional(),
apply_to_quantity: z.number().nullish(),
buy_rules_min_quantity: z.number().nullish(),
})
@@ -186,9 +184,7 @@ export const UpdatePromotion = z
is_automatic: z.boolean().optional(),
type: z.nativeEnum(PromotionType).optional(),
campaign_id: z.string().nullish(),
campaign: CreateCampaign.optional(),
application_method: AdminUpdateApplicationMethod.optional(),
rules: z.array(AdminCreatePromotionRule).optional(),
})
.strict()