feat(medusa, stock-location, types): Add q and order params to list-stock-locations (#6197)

**What**
- add `q` and `order` params to list-stock-location endpoint

closes #6189
This commit is contained in:
Philip Korsholm
2024-01-29 09:14:39 +00:00
committed by GitHub
parent 3db2f95e65
commit d1c18a3090
9 changed files with 263 additions and 33 deletions
@@ -1,5 +1,5 @@
import { IStockLocationService } from "@medusajs/types"
import { IsOptional } from "class-validator"
import { IsOptional, IsString } from "class-validator"
import { Request, Response } from "express"
import {
SalesChannelLocationService,
@@ -231,6 +231,13 @@ export class AdminGetStockLocationsParams extends extendedFindParamsMixin({
limit: 20,
offset: 0,
}) {
/**
* Search term to search stock location names.
*/
@IsString()
@IsOptional()
q?: string
/**
* IDs to filter stock locations by.
*/
@@ -258,4 +265,11 @@ export class AdminGetStockLocationsParams extends extendedFindParamsMixin({
@IsOptional()
@IsType([String, [String]])
sales_channel_id?: string | string[]
/**
* The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
*/
@IsString()
@IsOptional()
order?: string
}