Fix: FormArrays were not getting cleared and were basically fucking the whole thing up.
Fix: EmployeeAttendance was borking because the inital employee was null.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
@@ -35,6 +35,9 @@ export class EmployeeAttendanceService {
|
||||
}
|
||||
|
||||
save(employeeAttendance: EmployeeAttendance): Observable<EmployeeAttendance> {
|
||||
if (!employeeAttendance.employee) {
|
||||
return observableOf(new EmployeeAttendance());
|
||||
}
|
||||
const { id } = employeeAttendance.employee;
|
||||
return this.http
|
||||
.post<EmployeeAttendance>(`${url}/${id}`, employeeAttendance)
|
||||
|
||||
Reference in New Issue
Block a user