Skip to content

Commit

Permalink
chore : added transform to support both APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Xitija committed Mar 21, 2024
1 parent 0537001 commit 384a457
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/altStudent/dto/alt-student.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class StudentDto {
example: Promotion.promoted,
})
@Expose()
@Transform(({ value }) => (value.trim() === "" ? null : value))
@Transform(({ value }) => value ? (value.trim() !== "" ? value.trim() : null) : null)
@IsEnum(Promotion)
@IsOptional()
promotion: string; // keep blank when user is new
Expand Down

0 comments on commit 384a457

Please sign in to comment.