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