feat(medusa, medusa-js, medusa-react): Implement Sales Channel retrieval (#1793)
This commit is contained in:
@@ -18,6 +18,7 @@ import AdminProductsResource from "./products"
|
||||
import AdminRegionsResource from "./regions"
|
||||
import AdminReturnReasonsResource from "./return-reasons"
|
||||
import AdminReturnsResource from "./returns"
|
||||
import AdminSalesChannelsResource from "./sales-channels"
|
||||
import AdminShippingOptionsResource from "./shipping-options"
|
||||
import AdminShippingProfilesResource from "./shipping-profiles"
|
||||
import AdminStoresResource from "./store"
|
||||
@@ -47,6 +48,7 @@ class Admin extends BaseResource {
|
||||
public orders = new AdminOrdersResource(this.client)
|
||||
public returnReasons = new AdminReturnReasonsResource(this.client)
|
||||
public variants = new AdminVariantsResource(this.client)
|
||||
public salesChannels = new AdminSalesChannelsResource(this.client)
|
||||
public swaps = new AdminSwapsResource(this.client)
|
||||
public shippingProfiles = new AdminShippingProfilesResource(this.client)
|
||||
public store = new AdminStoresResource(this.client)
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
import {
|
||||
AdminSalesChannelRes,
|
||||
} from "@medusajs/medusa"
|
||||
import { ResponsePromise } from "../../typings"
|
||||
import BaseResource from "../base"
|
||||
|
||||
class AdminSalesChannelsResource extends BaseResource {
|
||||
/**
|
||||
* @description gets a sales channel
|
||||
* @returns a medusa sales channel
|
||||
*/
|
||||
retrieve(
|
||||
salesChannelId: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminSalesChannelRes> {
|
||||
const path = `/admin/sales-channels/${salesChannelId}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
}
|
||||
|
||||
/*create(
|
||||
payload: any,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<any> {}*/
|
||||
|
||||
/*update(
|
||||
id: string,
|
||||
payload: any,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<any> {}*/
|
||||
|
||||
/*delete(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<any> {
|
||||
}*/
|
||||
|
||||
/*list(
|
||||
query?: any,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<any> {
|
||||
}*/
|
||||
}
|
||||
|
||||
export default AdminSalesChannelsResource
|
||||
Reference in New Issue
Block a user