fix(employee) change dto so that module access is typesafe, modify update route to exclude session email
This commit is contained in:
parent
35a71d217a
commit
838189ae1f
|
|
@ -542,6 +542,16 @@
|
||||||
"patch": {
|
"patch": {
|
||||||
"operationId": "EmployeesController_updateEmployee",
|
"operationId": "EmployeesController_updateEmployee",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/EmployeeDetailedDto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": ""
|
"description": ""
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ export class EmployeesController {
|
||||||
|
|
||||||
@Patch('update')
|
@Patch('update')
|
||||||
@ModuleAccessAllowed(ModulesEnum.employee_management)
|
@ModuleAccessAllowed(ModulesEnum.employee_management)
|
||||||
async updateEmployee(@Access('email') email:string, dto:EmployeeDetailedDto, employee_email?: string){
|
async updateEmployee(@Body() dto:EmployeeDetailedDto){
|
||||||
return await this.updateService.updateEmployee(email, dto, employee_email);
|
return await this.updateService.updateEmployee(dto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,5 +15,5 @@ export class EmployeeDetailedDto {
|
||||||
@IsDateString() @IsOptional() last_work_day?: string;
|
@IsDateString() @IsOptional() last_work_day?: string;
|
||||||
@IsString() @IsOptional() residence?: string;
|
@IsString() @IsOptional() residence?: string;
|
||||||
@IsInt() @IsPositive() @Type(() => Number) external_payroll_id: number;
|
@IsInt() @IsPositive() @Type(() => Number) external_payroll_id: number;
|
||||||
@IsString() @IsArray() user_module_access: string[];
|
@IsArray() @IsString({ each: true }) user_module_access: string[];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user