fix(medusa): Move discount usage from rule to discount
This commit is contained in:
@@ -38,6 +38,8 @@ describe("POST /admin/discounts/:discount_id/regions/:region_id", () => {
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"usage_limit",
|
||||
"usage_count",
|
||||
"starts_at",
|
||||
"ends_at",
|
||||
"created_at",
|
||||
|
||||
@@ -38,6 +38,8 @@ describe("POST /admin/discounts/:discount_id/variants/:variant_id", () => {
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"usage_limit",
|
||||
"usage_count",
|
||||
"starts_at",
|
||||
"ends_at",
|
||||
"created_at",
|
||||
|
||||
@@ -9,6 +9,8 @@ const defaultFields = [
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"usage_limit",
|
||||
"usage_count",
|
||||
"starts_at",
|
||||
"ends_at",
|
||||
"created_at",
|
||||
|
||||
@@ -9,6 +9,8 @@ const defaultFields = [
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"usage_limit",
|
||||
"usage_count",
|
||||
"starts_at",
|
||||
"ends_at",
|
||||
"created_at",
|
||||
|
||||
@@ -9,6 +9,8 @@ const defaultFields = [
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"usage_limit",
|
||||
"usage_count",
|
||||
"starts_at",
|
||||
"ends_at",
|
||||
"created_at",
|
||||
|
||||
@@ -26,6 +26,7 @@ export default async (req, res) => {
|
||||
|
||||
const schema = Validator.object().keys({
|
||||
code: Validator.string().required(),
|
||||
usage_limit: Validator.number().default(1),
|
||||
metadata: Validator.object().optional(),
|
||||
})
|
||||
|
||||
|
||||
@@ -62,6 +62,8 @@ export const defaultFields = [
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"usage_limit",
|
||||
"usage_count",
|
||||
"starts_at",
|
||||
"ends_at",
|
||||
"created_at",
|
||||
|
||||
Reference in New Issue
Block a user