cast selector to RemoteQueryFilters

This commit is contained in:
Pedro Guzman committed 2025-06-14 02:09:50 +02:00
1 parent 2d87346bb2
commit 8443d37275
1 file changed
+6 -5
@@ -1,5 +1,6 @@
import { import {
FilterableStockLocationProps, FilterableStockLocationProps,
RemoteQueryFilters,
StockLocationDTO, StockLocationDTO,
UpdateStockLocationInput, UpdateStockLocationInput,
UpsertStockLocationAddressInput, UpsertStockLocationAddressInput,
@@ -32,10 +33,10 @@ export const updateStockLocationsWorkflowId = "update-stock-locations-workflow"
/** /**
* This workflow updates stock locations matching the specified filters. It's used by the * This workflow updates stock locations matching the specified filters. It's used by the
* [Update Stock Location Admin API Route](https://docs.medusajs.com/api/admin#stock-locations_poststocklocationsid). * [Update Stock Location Admin API Route](https://docs.medusajs.com/api/admin#stock-locations_poststocklocationsid).
* *
* You can use this workflow within your own customizations or custom workflows, allowing you * You can use this workflow within your own customizations or custom workflows, allowing you
* to update stock locations in your custom flows. * to update stock locations in your custom flows.
* *
* @example * @example
* const { result } = await updateStockLocationsWorkflow(container) * const { result } = await updateStockLocationsWorkflow(container)
* .run({ * .run({
@@ -48,9 +49,9 @@ export const updateStockLocationsWorkflowId = "update-stock-locations-workflow"
* } * }
* } * }
* }) * })
* *
* @summary * @summary
* *
* Update stock locations. * Update stock locations.
*/ */
export const updateStockLocationsWorkflow = createWorkflow( export const updateStockLocationsWorkflow = createWorkflow(
@@ -60,7 +61,7 @@ export const updateStockLocationsWorkflow = createWorkflow(
): WorkflowResponse<StockLocationDTO[]> => { ): WorkflowResponse<StockLocationDTO[]> => {
const stockLocationsQuery = useQueryGraphStep({ const stockLocationsQuery = useQueryGraphStep({
entity: "stock_location", entity: "stock_location",
filters: input.selector, filters: input.selector as RemoteQueryFilters<"stock_location">,
fields: ["id", "address.id"], fields: ["id", "address.id"],
}).config({ name: "get-stock-location" }) }).config({ name: "get-stock-location" })