Skip to content

Commit

Permalink
correct validateur langAlt
Browse files Browse the repository at this point in the history
  • Loading branch information
fufeck committed Dec 19, 2023
1 parent 9efc01e commit 3d375c9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/api/src/modules/toponyme/dto/create_toponyme.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class CreateToponymeDTO {

@IsOptional()
@IsNotEmptyObject()
@Validate(ValidatorBal, ['nom_alt'])
@Validate(ValidatorBal, ['langAlt'])
@ApiProperty({ required: false, nullable: true })
nomAlt: Record<string, string>;

Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/modules/toponyme/dto/update_toponyme.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class UpdateToponymeDTO {

@IsOptional()
@IsNotEmptyObject()
@Validate(ValidatorBal, ['nom_alt'])
@Validate(ValidatorBal, ['langAlt'])
@ApiProperty({ required: false, nullable: true })
nomAlt: Record<string, string>;

Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/modules/voie/dto/create_voie.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class CreateVoieDTO {

@IsOptional()
@IsNotEmptyObject()
@Validate(ValidatorBal, ['nom_alt'])
@Validate(ValidatorBal, ['langAlt'])
@ApiProperty({ required: false, nullable: true })
nomAlt: Record<string, string>;

Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/modules/voie/dto/update_voie.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class UpdateVoieDTO {

@IsOptional()
@IsNotEmptyObject()
@Validate(ValidatorBal, ['nom_alt'])
@Validate(ValidatorBal, ['langAlt'])
@ApiProperty({ required: false, nullable: true })
nomAlt: Record<string, string>;

Expand Down
2 changes: 1 addition & 1 deletion libs/shared/src/validators/validator_bal.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ValidatorBal implements ValidatorConstraintInterface {
} else if (field === 'nom') {
const { errors } = await validateurBAL(value.toString(), 'voie_nom');
return errors.length === 0;
} else if (field === 'nom_alt') {
} else if (field === 'langAlt') {
Object.keys(value).forEach(async (codeISO) => {
if (supportedNomAlt.has(codeISO)) {
const nomVoie = value[codeISO];
Expand Down

0 comments on commit 3d375c9

Please sign in to comment.