Skip to content

Commit

Permalink
Fixed template id required error for only qr code generation in crede…
Browse files Browse the repository at this point in the history
…ntials
  • Loading branch information
holashchand committed Jun 20, 2024
1 parent 9c09f34 commit 6e98801
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export class CredentialsController {
const requestedTemplateId: string = req.headers['templateid'] as string;
const externalTemplate: string = req.headers['template'] as string;

if (!requestedTemplateId && !externalTemplate && accept !== 'application/json')
throw new BadRequestException('Template id is required');
if (!requestedTemplateId && !externalTemplate && ['application/pdf', 'text/html'].indexOf(accept) > -1)
throw new BadRequestException('Template id or template is required');
else if (!requestedTemplateId && !externalTemplate && accept === 'application/json')
return this.credentialsService.getCredentialById(
id,
Expand Down

0 comments on commit 6e98801

Please sign in to comment.