Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request @DtoUpdateRequired #40

Closed
KoenLemmen opened this issue May 28, 2024 · 2 comments
Closed

Feature request @DtoUpdateRequired #40

KoenLemmen opened this issue May 28, 2024 · 2 comments

Comments

@KoenLemmen
Copy link

KoenLemmen commented May 28, 2024

Please add a decorator that sets an update DTO property to required: true and no ? and @IsOptional()

For example:

  @ApiProperty({
    type: 'string',
    required: false,
  })
  @IsOptional()
  @IsString()
  name?: string;

Would become

  @ApiProperty({
    type: 'string',
    required: true, // or if true by default remove this line
  })
  @IsString()
  name: string;

Right now I modify this manually locally, but we run prisma generate during CI/CD and this overwrites the manually edited DTO's causing errors.
Please consider this for users who want a property in update to be required for each update.

@Brakebein
Copy link
Owner

Thanks! I just released a new version that includes your additions.

@KoenLemmen
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants