fix(server): http error parsing on endpoints without a default response (#12927)

This commit is contained in:
Jason Rasmussen 2024-09-25 12:05:03 -04:00 committed by GitHub
parent 8d515adac5
commit 005528ab5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 162 additions and 18 deletions

View file

@ -1,6 +1,7 @@
import { Body, Controller, HttpCode, HttpStatus, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { AuthDto } from 'src/dtos/auth.dto';
import { TestEmailResponseDto } from 'src/dtos/notification.dto';
import { SystemConfigSmtpDto } from 'src/dtos/system-config.dto';
import { Auth, Authenticated } from 'src/middleware/auth.guard';
import { NotificationService } from 'src/services/notification.service';
@ -13,7 +14,7 @@ export class NotificationController {
@Post('test-email')
@HttpCode(HttpStatus.OK)
@Authenticated({ admin: true })
sendTestEmail(@Auth() auth: AuthDto, @Body() dto: SystemConfigSmtpDto) {
sendTestEmail(@Auth() auth: AuthDto, @Body() dto: SystemConfigSmtpDto): Promise<TestEmailResponseDto> {
return this.service.sendTestEmail(auth.user.id, dto);
}
}