diff --git a/services/credentials-service/src/credentials/credentials.controller.ts b/services/credentials-service/src/credentials/credentials.controller.ts index 879a6efce..5c2b43549 100644 --- a/services/credentials-service/src/credentials/credentials.controller.ts +++ b/services/credentials-service/src/credentials/credentials.controller.ts @@ -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,