fix: corrige les associations constructeurs
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import { IsString, IsOptional, IsNumber, IsObject } from 'class-validator';
|
||||
import {
|
||||
IsString,
|
||||
IsOptional,
|
||||
IsNumber,
|
||||
IsObject,
|
||||
IsArray,
|
||||
} from 'class-validator';
|
||||
import { Transform } from 'class-transformer';
|
||||
|
||||
export class CreateComposantDto {
|
||||
@@ -18,8 +24,10 @@ export class CreateComposantDto {
|
||||
reference?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
constructeurId?: string;
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
constructeurIds?: string[];
|
||||
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => (value === '' ? null : value))
|
||||
@@ -49,8 +57,9 @@ export class UpdateComposantDto {
|
||||
reference?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
constructeurId?: string;
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
constructeurIds?: string[];
|
||||
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => (value === '' ? null : value))
|
||||
|
||||
@@ -154,8 +154,9 @@ export class CreateMachineDto {
|
||||
reference?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
constructeurId?: string;
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
constructeurIds?: string[];
|
||||
|
||||
@IsOptional()
|
||||
@IsDecimal()
|
||||
@@ -188,8 +189,9 @@ export class UpdateMachineDto {
|
||||
reference?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
constructeurId?: string;
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
constructeurIds?: string[];
|
||||
|
||||
@IsOptional()
|
||||
@IsDecimal()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IsString, IsOptional, IsNumber } from 'class-validator';
|
||||
import { IsString, IsOptional, IsNumber, IsArray } from 'class-validator';
|
||||
import { Transform } from 'class-transformer';
|
||||
|
||||
export class CreatePieceDto {
|
||||
@@ -18,8 +18,10 @@ export class CreatePieceDto {
|
||||
reference?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
constructeurId?: string;
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
constructeurIds?: string[];
|
||||
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => (value === '' ? null : value))
|
||||
@@ -45,8 +47,10 @@ export class UpdatePieceDto {
|
||||
reference?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
constructeurId?: string;
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
constructeurIds?: string[];
|
||||
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => (value === '' ? null : value))
|
||||
|
||||
Reference in New Issue
Block a user