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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user