fix(admin-ui, medusa): Require name in create stock location (#3670)
* initial fix * add changeset * remove company from required fields
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
import { IStockLocationService } from "@medusajs/types"
|
||||
import { Type } from "class-transformer"
|
||||
import { IsObject, IsOptional, IsString, ValidateNested } from "class-validator"
|
||||
import {
|
||||
IsNotEmpty,
|
||||
IsObject,
|
||||
IsOptional,
|
||||
IsString,
|
||||
ValidateNested,
|
||||
} from "class-validator"
|
||||
import { Request, Response } from "express"
|
||||
import { Transform, Type } from "class-transformer"
|
||||
|
||||
import { FindParams } from "../../../../types/common"
|
||||
import { IStockLocationService } from "@medusajs/types"
|
||||
|
||||
/**
|
||||
* @oas [post] /admin/stock-locations
|
||||
@@ -138,6 +145,8 @@ class StockLocationAddress {
|
||||
*/
|
||||
export class AdminPostStockLocationsReq {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@Transform(({ value }: { value: string }) => value?.trim())
|
||||
name: string
|
||||
|
||||
@IsOptional()
|
||||
|
||||
Reference in New Issue
Block a user