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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user