Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add discount condition batch #2430

Merged
merged 12 commits into from
Oct 13, 2022
7 changes: 7 additions & 0 deletions .changeset/fast-suns-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@medusajs/medusa-js": patch
"medusa-react": patch
"@medusajs/medusa": patch
---

Feat(medusa, medusa-js, medusa-react): add resources to discount condition by batch
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ Object {
}
`;

exports[`/admin/discounts GET /admin/discounts/:id/conditions/:condition_id throws if condition does not belong to discount: DiscountCondition with id test-condition was not found for Discount test-discount-2 1`] = `"Request failed with status code 404"`;

exports[`/admin/discounts GET /admin/discounts/:id/conditions/:condition_id throws if condition does not exist: DiscountCondition with id test-condition was not found 1`] = `"Request failed with status code 404"`;

exports[`/admin/discounts POST /admin/discounts fails if multiple types of resources are provided on update 1`] = `
Object {
"message": "Only one of products, product_types is allowed, Only one of product_types, products is allowed",
Expand All @@ -77,8 +73,6 @@ Object {
}
`;

exports[`/admin/discounts POST /admin/discounts/:id/conditions fails if more than one condition type is provided: Only one of products, customer_groups is allowed, Only one of customer_groups, products is allowed 1`] = `"Request failed with status code 400"`;

exports[`/admin/discounts POST /admin/discounts/:id/conditions should create a condition 1`] = `
Object {
"code": "TEST",
Expand Down Expand Up @@ -124,8 +118,6 @@ Object {
}
`;

exports[`/admin/discounts POST /admin/discounts/:id/conditions throws if discount does not exist: Discount with id does-not-exist was not found 1`] = `"Request failed with status code 404"`;

exports[`/admin/discounts POST /admin/discounts/:id/conditions/:condition_id should update a condition 1`] = `
Object {
"code": "TEST",
Expand Down Expand Up @@ -197,7 +189,3 @@ Object {
"valid_duration": null,
}
`;

exports[`/admin/discounts POST /admin/discounts/:id/conditions/:condition_id throws if condition does not exist: DiscountCondition with id does-not-exist was not found for Discount test-discount 1`] = `"Request failed with status code 404"`;

exports[`/admin/discounts POST /admin/discounts/:id/conditions/:condition_id throws if discount does not exist: Discount with id does-not-exist was not found 1`] = `"Request failed with status code 404"`;
Loading