fix(api): use PrismaClientKnownRequestError instanceof, add ConflictException for duplicate routes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-28 01:13:05 +05:30
parent 6b4920ce41
commit d92476f841
3 changed files with 32 additions and 10 deletions
@@ -11,8 +11,8 @@ export class RoutesController {
}
@Post()
create(@Body() body: { sourceGroupId?: string; targetGroupId?: string }) {
return this.routesService.create(body.sourceGroupId ?? '', body.targetGroupId ?? '');
create(@Body() body: { sourceGroupId: string; targetGroupId: string }) {
return this.routesService.create(body.sourceGroupId, body.targetGroupId);
}
@Delete(':id')