feat(medusa, medusa-js, medusa-react): Implement Sales Channel deletion (#1804)

This commit is contained in:
Adrien de Peretti
2022-07-07 10:47:51 +02:00
committed by GitHub
parent 4d15e01c3e
commit 2d03634cfc
13 changed files with 368 additions and 21 deletions
@@ -2,6 +2,7 @@ import {
AdminPostSalesChannelsReq,
AdminSalesChannelsRes,
AdminPostSalesChannelsSalesChannelReq,
AdminSalesChannelsDeleteRes,
} from "@medusajs/medusa"
import { ResponsePromise } from "../../typings"
import BaseResource from "../base"
@@ -48,17 +49,26 @@ class AdminSalesChannelsResource extends BaseResource {
return this.client.request("POST", path, payload, {}, customHeaders)
}
/* delete(
id: string,
customHeaders: Record<string, any> = {}
): ResponsePromise<any> {
}*/
/* list(
query?: any,
customHeaders: Record<string, any> = {}
): ResponsePromise<any> {
}*/
/**
* Delete a sales channel
* @experimental This feature is under development and may change in the future.
* To use this feature please enable featureflag `sales_channels` in your medusa backend project.
* @description gets a sales channel
* @returns an deletion result
*/
delete(
salesChannelId: string,
customHeaders: Record<string, any> = {}
): ResponsePromise<AdminSalesChannelsDeleteRes> {
const path = `/admin/sales-channels/${salesChannelId}`
return this.client.request("DELETE", path, {}, {}, customHeaders)
}
}
export default AdminSalesChannelsResource