fix(dashboard,medusa,fulfillment): Move Shipping Profiles to settings (#7090)
**What** - Moves Shipping Profiles to settings - Adds `q` and filters to shipping profile list endpoint - Adds new details page for profiles
This commit is contained in:
@@ -1,27 +1,35 @@
|
||||
import { deleteRequest, getRequest, postRequest } from "./common"
|
||||
import { CreateShippingProfileReq } from "../../types/api-payloads"
|
||||
import {
|
||||
ShippingProfileDeleteRes,
|
||||
ShippingProfileListRes,
|
||||
ShippingProfileRes,
|
||||
} from "../../types/api-responses"
|
||||
import { deleteRequest, getRequest, postRequest } from "./common"
|
||||
|
||||
async function createShippingProfile(payload: CreateShippingProfileReq) {
|
||||
return postRequest<ShippingProfileRes>(`/admin/shipping-profiles`, payload)
|
||||
}
|
||||
|
||||
async function retrieveShippingProfile(
|
||||
id: string,
|
||||
query?: Record<string, any>
|
||||
) {
|
||||
return getRequest<ShippingProfileRes>(`/admin/shipping-profiles/${id}`, query)
|
||||
}
|
||||
|
||||
async function listShippingProfiles(query?: Record<string, any>) {
|
||||
return getRequest<ShippingProfileListRes>(`/admin/shipping-profiles`, query)
|
||||
}
|
||||
|
||||
async function deleteShippingProfile(profileId: string) {
|
||||
async function deleteShippingProfile(id: string) {
|
||||
return deleteRequest<ShippingProfileDeleteRes>(
|
||||
`/admin/shipping-profiles/${profileId}`
|
||||
`/admin/shipping-profiles/${id}`
|
||||
)
|
||||
}
|
||||
|
||||
export const shippingProfiles = {
|
||||
create: createShippingProfile,
|
||||
retrieve: retrieveShippingProfile,
|
||||
list: listShippingProfiles,
|
||||
create: createShippingProfile,
|
||||
delete: deleteShippingProfile,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user