Skip to content

Commit 20b1389

Browse files
authored
fix: success message and othe minor changes (#1281)
Signed-off-by: Krishna Waske <[email protected]>
1 parent b255849 commit 20b1389

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

apps/api-gateway/src/agent-service/agent-service.controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class AgentController {
127127
const agentData = await this.agentService.signData(data, orgId);
128128
const finalResponse: IResponse = {
129129
statusCode: HttpStatus.OK,
130-
message: ResponseMessages.agent.success.health,
130+
message: ResponseMessages.agent.success.sign,
131131
data: agentData
132132
};
133133

@@ -173,10 +173,10 @@ export class AgentController {
173173
@Param('dataType') dataType: string,
174174
@Res() res: Response
175175
): Promise<Response> {
176-
const agentData = await this.agentService.signData(data, orgId);
176+
const agentData = await this.agentService.verifysignature(data, orgId);
177177
const finalResponse: IResponse = {
178178
statusCode: HttpStatus.OK,
179-
message: ResponseMessages.agent.success.health,
179+
message: ResponseMessages.agent.success.verify,
180180
data: agentData
181181
};
182182

apps/api-gateway/src/agent-service/dto/agent-service.dto.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
import { CreateDidDto } from './create-did.dto';
2424
import { KeyType } from '@credebl/enum/enum';
2525
import { RewriteValidationOptions } from '@credebl/common/custom-overrideable-validation-pipe';
26+
import { BadRequestException } from '@nestjs/common';
2627
const regex = /^[a-zA-Z0-9 ]*$/;
2728
export class AgentSpinupDto extends CreateDidDto {
2829
@ApiProperty()
@@ -150,7 +151,7 @@ class AtLeastOneKeyConstraint implements ValidatorConstraintInterface {
150151
}
151152

152153
defaultMessage(): string {
153-
return 'At least one of publicKeyBase58, did, or method must be provided.';
154+
throw new BadRequestException('At least one of publicKeyBase58, did, or method must be provided in SignRawDataDto');
154155
}
155156
}
156157

libs/common/src/response-messages/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ export const ResponseMessages = {
212212
createDid: 'Did created successfully',
213213
health: 'Agent health details retrieved successfully.',
214214
ledgerConfig: 'Ledger config details fetched successfully.',
215+
sign: 'Payload signed successfully.',
216+
verify: 'Payload verified successfully.',
215217
webhookUrlRegister: 'Webhook Url registered successfully',
216218
getWebhookUrl: 'Webhook Url fetched successfully',
217219
createKeys: 'Key-pair created successfully',

0 commit comments

Comments
 (0)