fix(employees): fix profile route to actually include email in route as param

This commit is contained in:
Nicolas Drolet 2025-08-15 17:02:35 -04:00
parent 45386ac4bf
commit ee90bde58c
2 changed files with 5 additions and 3 deletions

View File

@ -384,7 +384,7 @@
] ]
} }
}, },
"/employees/profile": { "/employees/profile/{email}": {
"get": { "get": {
"operationId": "EmployeesController_findOneProfile", "operationId": "EmployeesController_findOneProfile",
"parameters": [ "parameters": [
@ -392,6 +392,7 @@
"name": "email", "name": "email",
"required": true, "required": true,
"in": "path", "in": "path",
"description": "Identifier of the employee",
"schema": { "schema": {
"type": "string" "type": "string"
} }

View File

@ -51,11 +51,12 @@ export class EmployeesController {
return this.employeesService.findOne(id); return this.employeesService.findOne(id);
} }
@Get('profile') @Get('profile/:email')
@ApiOperation({summary: 'Find employee profile' }) @ApiOperation({summary: 'Find employee profile' })
@ApiParam({ name: 'email', type: String, description: 'Identifier of the employee' })
@ApiResponse({ status: 200, description: 'Employee profile found', type: EmployeeProfileItemDto }) @ApiResponse({ status: 200, description: 'Employee profile found', type: EmployeeProfileItemDto })
@ApiResponse({ status: 400, description: 'Employee profile not found' }) @ApiResponse({ status: 400, description: 'Employee profile not found' })
findOneProfile(@Param('email', ParseIntPipe)email: string): Promise<EmployeeProfileItemDto> { findOneProfile(@Param('email') email: string): Promise<EmployeeProfileItemDto> {
return this.employeesService.findOneProfile(email); return this.employeesService.findOneProfile(email);
} }