Skip to content

Commit

Permalink
add: zap changes merged from main
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna <krishna.waske@ayanworks.com>
  • Loading branch information
GHkrishna authored and KulkarniShashank committed Sep 11, 2024
1 parent 2b64324 commit d292a94
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ApiExtraModels, ApiPropertyOptional } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsString, IsBoolean, MaxLength, MinLength, Validate } from 'class-validator';

import { Transform } from 'class-transformer';
import { ImageBase64Validator, IsNotUUID, trim } from '@credebl/common/cast.helper';
import { ImageBase64Validator, trim } from '@credebl/common/cast.helper';

@ApiExtraModels()
export class UpdateOrganizationDto {
Expand All @@ -17,7 +17,6 @@ export class UpdateOrganizationDto {
@MinLength(2, { message: 'Organization name must be at least 2 characters.' })
@MaxLength(50, { message: 'Organization name must be at most 50 characters.' })
@IsString({ message: 'Organization name must be in string format.' })
@IsNotUUID({message: 'Invalid orgName'})
name: string;

@ApiPropertyOptional()
Expand Down
1 change: 1 addition & 0 deletions apps/api-gateway/src/verification/dto/request-proof.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export class IndyDto {
export class RequestProofDto extends ProofPayload {
@ApiProperty()
@IsString()
@Transform(({ value }) => trim(value))
@IsUUID()
@IsNotEmpty({ message: 'connectionId is required.' })
connectionId: string;
Expand Down
26 changes: 13 additions & 13 deletions libs/common/src/cast.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@ export class ImageBase64Validator implements ValidatorConstraintInterface {
}
}

export const IsNotUUID = (validationOptions?: ValidationOptions): PropertyDecorator => (object: object, propertyName: string) => {
registerDecorator({
name: 'isNotUUID',
target: object.constructor,
propertyName,
options: validationOptions,
validator: {
validate(value) {
return !isUUID(value);
}
}
});
};
// export const IsNotUUID = (validationOptions?: ValidationOptions): PropertyDecorator => (object: object, propertyName: string) => {
// registerDecorator({
// name: 'isNotUUID',
// target: object.constructor,
// propertyName,
// options: validationOptions,
// validator: {
// validate(value) {
// return !isUUID(value);
// }
// }
// });
// };

0 comments on commit d292a94

Please sign in to comment.