fix: Response wrapping, error logging, and controller hardening (COA 3)
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
- HttpExceptionFilter: Log actual error details for non-HttpExceptions (was silently swallowing 500s)
- ServersService: Return null fields instead of 404 for new licenses without servers
- NotificationsController: Wrap config responses as { config } to match frontend expectations
- WebstoreController: Wrap config responses as { config } to match frontend expectations
- ChatController: Replace ParseIntPipe with manual parseInt (400 on missing optional param)
- WipesController: Same ParseIntPipe fix for history limit param
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Controller, Get, Put, Param, Body, Query, ParseIntPipe, UseGuards } from '@nestjs/common';
|
||||
import { Controller, Get, Put, Param, Body, Query, UseGuards } from '@nestjs/common';
|
||||
import { ApiTags, ApiBearerAuth, ApiOperation, ApiQuery } from '@nestjs/swagger';
|
||||
import { ChatService } from './chat.service';
|
||||
import { FlagMessageDto } from './dto/flag-message.dto';
|
||||
@@ -21,9 +21,10 @@ export class ChatController {
|
||||
@ApiQuery({ name: 'limit', required: false, example: 100 })
|
||||
async getMessages(
|
||||
@CurrentTenant() licenseId: string,
|
||||
@Query('limit', new ParseIntPipe({ optional: true })) limit?: number,
|
||||
@Query('limit') limit?: string,
|
||||
) {
|
||||
return await this.chatService.getMessages(licenseId, limit || 100);
|
||||
const limitNum = limit ? parseInt(limit, 10) : 100;
|
||||
return await this.chatService.getMessages(licenseId, limitNum);
|
||||
}
|
||||
|
||||
@Put(':id/flag')
|
||||
|
||||
Reference in New Issue
Block a user