fix(employees): fix profile route to actually include email in route as param
This commit is contained in:
parent
45386ac4bf
commit
ee90bde58c
|
|
@ -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"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user