feat(medusa): Support batch remove resources on discount condition (#2444)
**what** - Add support to remove resources by batch on discount conditions - Add support on medusa-js and medusa-react **Tests** - Add integration tests to validate that the resources have been deleted and the length is the one expected - Add unit tests on medusa react FIXES CORE-609
This commit is contained in:
@@ -939,6 +939,29 @@ export const adminHandlers = [
|
||||
}
|
||||
),
|
||||
|
||||
rest.delete(
|
||||
"/admin/discounts/:id/conditions/:conditionId/batch",
|
||||
(req, res, ctx) => {
|
||||
return res(
|
||||
ctx.status(200),
|
||||
ctx.json({
|
||||
discount: {
|
||||
...fixtures.get("discount"),
|
||||
rule: {
|
||||
...fixtures.get("discount").rule,
|
||||
conditions: [
|
||||
{
|
||||
...fixtures.get("discount").rule.conditions[0],
|
||||
products: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
})
|
||||
)
|
||||
}
|
||||
),
|
||||
|
||||
rest.get("/admin/draft-orders/", (req, res, ctx) => {
|
||||
return res(
|
||||
ctx.status(200),
|
||||
|
||||
Reference in New Issue
Block a user