Skip to content
Snippets Groups Projects
Commit db0a2a94 authored by Boyan Tsolov's avatar Boyan Tsolov
Browse files

fix: class validator check type

parent e7c360d3
No related branches found
No related tags found
No related merge requests found
Pipeline #66566 waiting for manual action with stages
in 21 minutes and 23 seconds
......@@ -410,8 +410,7 @@ export class AgentService {
if (acceptProofDto.proofUrl) {
return this.acceptOobProof(acceptProofDto.proofUrl);
}
// REVIEW: should the undefined case be covered inside acceptConnectionProof?
return this.acceptConnectionProof(acceptProofDto.proofRecordId as string);
return this.acceptConnectionProof(acceptProofDto.proofRecordId);
};
acceptOobProof = async (url: string) => {
......
......@@ -2,13 +2,13 @@ import { IsNotEmpty, IsString, ValidateIf } from "class-validator";
export class ProofReqDto {
@ValidateIf((o) => o.proofUrl === undefined, { always: true })
@ValidateIf((o) => o && typeof o.proofUrl === 'undefined')
@IsString()
@IsNotEmpty()
proofRecordId: string | undefined;
proofRecordId: string;
@ValidateIf((o) => o.proofRecordId === undefined, { always: true })
@ValidateIf((o) => o && typeof o.proofRecordId === 'undefined')
@IsString()
@IsNotEmpty()
proofUrl: string | undefined;
proofUrl: string;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment