feat(medusa): add stock_location_id filter to providers api (#8319)
what: - adds a filter to fulfillment providers API to scope by stock locations RESOLVES CC-260
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { MiddlewareRoute } from "../../../types/middlewares"
|
||||
import { maybeApplyLinkFilter } from "../../utils/maybe-apply-link-filter"
|
||||
import { validateAndTransformQuery } from "../../utils/validate-query"
|
||||
import * as QueryConfig from "./query-config"
|
||||
import { AdminFulfillmentProvidersParams } from "./validators"
|
||||
@@ -12,6 +13,11 @@ export const adminFulfillmentProvidersRoutesMiddlewares: MiddlewareRoute[] = [
|
||||
AdminFulfillmentProvidersParams,
|
||||
QueryConfig.listTransformQueryConfig
|
||||
),
|
||||
maybeApplyLinkFilter({
|
||||
entryPoint: "location_fulfillment_provider",
|
||||
resourceId: "fulfillment_provider_id",
|
||||
filterableField: "stock_location_id",
|
||||
}),
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
@@ -12,6 +12,7 @@ export const AdminFulfillmentProvidersParams = createFindParams({
|
||||
.merge(
|
||||
z.object({
|
||||
id: z.union([z.string(), z.array(z.string())]).optional(),
|
||||
stock_location_id: z.union([z.string(), z.array(z.string())]).optional(),
|
||||
is_enabled: OptionalBooleanValidator,
|
||||
q: z.string().optional(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user