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:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
AdminDeleteDiscountsDiscountConditionsConditionBatchReq,
|
||||
AdminDiscountConditionsRes,
|
||||
AdminDiscountsDeleteRes,
|
||||
AdminDiscountsListRes,
|
||||
@@ -230,6 +231,19 @@ class AdminDiscountsResource extends BaseResource {
|
||||
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Delete a batch of items from a discount condition
|
||||
*/
|
||||
deleteConditionResourceBatch(
|
||||
discountId: string,
|
||||
conditionId: string,
|
||||
payload: AdminDeleteDiscountsDiscountConditionsConditionBatchReq,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDiscountsRes> {
|
||||
const path = `/admin/discounts/${discountId}/conditions/${conditionId}/batch`
|
||||
return this.client.request("DELETE", path, payload, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
export default AdminDiscountsResource
|
||||
|
||||
Reference in New Issue
Block a user