Skip to content

Commit

Permalink
refactor: repo_validate_api: change bad req error format
Browse files Browse the repository at this point in the history
  • Loading branch information
toufiq-austcse committed May 19, 2023
1 parent 337fa4b commit 0901adc
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/api/deployments/dto/req/repository-req.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,23 @@ import { IsValidGitUrl } from '@common/validators/index';

export class ValidateRepositoryQueryDto {
@ApiProperty()
@IsUrl()
@IsNotEmpty()
@Validate(IsValidGitUrl)
@IsUrl({}, {
message: JSON.stringify({
key: 'repository_url',
message: 'repository_url should be a valid url'
})
})
@IsNotEmpty({
message: JSON.stringify({
key: 'repository_url',
message: 'repository_url is required'
})
})
@Validate(IsValidGitUrl, {
message: JSON.stringify({
key: 'repository_url',
message: 'repository_url should be a valid git url'
})
})
repository_url: string;
}

0 comments on commit 0901adc

Please sign in to comment.