fix(discount): allow all updates on discounts
This commit is contained in:
@@ -3,8 +3,9 @@ import { MedusaError, Validator } from "medusa-core-utils"
|
||||
export default async (req, res) => {
|
||||
const { discount_id } = req.params
|
||||
const schema = Validator.object().keys({
|
||||
code: Validator.string().required(),
|
||||
code: Validator.string().optional(),
|
||||
is_dynamic: Validator.boolean().default(false),
|
||||
is_giftcard: Validator.boolean().optional(),
|
||||
discount_rule: Validator.object()
|
||||
.keys({
|
||||
description: Validator.string().optional(),
|
||||
@@ -14,7 +15,7 @@ export default async (req, res) => {
|
||||
valid_for: Validator.array().items(Validator.string()),
|
||||
usage_limit: Validator.number().optional(),
|
||||
})
|
||||
.required(),
|
||||
.optional(),
|
||||
usage_count: Validator.number().optional(),
|
||||
disabled: Validator.boolean().optional(),
|
||||
starts_at: Validator.date().optional(),
|
||||
|
||||
Reference in New Issue
Block a user