-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
fix: Empty name ("") accepted as a valid name while creating environments #583
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
apps/api/src/environment/dto/create.environment/create.environment.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add relevant tests for this under environment.e2e.spec.ts
?
Yeah sure, |
Hey @rajdip-b i added the test case under environment.e2e.spec.ts. |
Hey @rajdip-b I updated the code according your suggestion. Review it please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
User description
Description
Add class-validator to check the property(name) is not empty before making the environmet.
Fixes #576
PR Type
Bug fix, Enhancement
Description
name
property is not empty when creating an environment.@IsNotEmpty()
decorator fromclass-validator
to enforce this rule.Changes walkthrough 📝
create.environment.ts
Enforce non-empty name for environment creation
apps/api/src/environment/dto/create.environment/create.environment.ts
@IsNotEmpty()
decorator to thename
property.name
field is not empty when creating an environment.