|
|
@@ -231,12 +231,6 @@ export class EmployeeFormComponent implements OnInit {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if (responseData.response.DOCUMENTS!.length > 0) {
|
|
|
- responseData.response.DOCUMENTS!.forEach(async document => {
|
|
|
- this.documentsEmployee.push(await this._encService.desencriptar(document));
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
this.putDataOnForm(responseData.response);
|
|
|
this.infoEmployee = {
|
|
|
SAVED_BY_USER: this.userId.value,
|
|
|
@@ -244,6 +238,20 @@ export class EmployeeFormComponent implements OnInit {
|
|
|
};
|
|
|
}, (error: HttpErrorResponse) => this._resourcesService.checkErrors(error)
|
|
|
);
|
|
|
+
|
|
|
+ await lastValueFrom(this._employeeService.getLastDocumentsByEmployee(this.idEmployee)).then(
|
|
|
+ (responseData: any) => {
|
|
|
+ console.log(responseData.response);
|
|
|
+ console.log("sad");
|
|
|
+ if (responseData.response.length > 0) {
|
|
|
+ responseData.response.forEach((document: any) => {
|
|
|
+ this.documentsEmployee.push(document);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, (error: HttpErrorResponse) => this._resourcesService.checkErrors(error)
|
|
|
+ );
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private async putDataOnForm(employee: Employee) {
|