fix betreft afspraken
This commit is contained in:
@@ -19,6 +19,8 @@ import {CustomerService} from '../../services/customer.service';
|
||||
import {ModalComponent} from '../modal/modal.component';
|
||||
import {timeAfterStartValidator} from '../../models/validators/time-after-start-validator';
|
||||
import {NewCustomerComponent} from '../new-customer/new-customer.component';
|
||||
import {UserService} from '../../services/user.service';
|
||||
import {AppointmentDto} from '../../models/appointment-dto';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-item',
|
||||
@@ -48,7 +50,7 @@ import {NewCustomerComponent} from '../new-customer/new-customer.component';
|
||||
export class NewItemComponent implements OnInit {
|
||||
|
||||
@Input() appointmentForm: FormGroup;
|
||||
@Input() appointments: Appointment[];
|
||||
@Input() appointments: AppointmentDto[];
|
||||
quickActions = ['Knippen', 'Kleuren', 'Knippen + Kleuren']
|
||||
waiting: boolean = false;
|
||||
protected value: TuiDay | null = null;
|
||||
@@ -59,7 +61,7 @@ export class NewItemComponent implements OnInit {
|
||||
timeError = new TuiValidationError('Begintijd moet voor de eindtijd liggen.');
|
||||
|
||||
|
||||
constructor(private appointmentService: AppointmentService, private customerService: CustomerService) {
|
||||
constructor(private appointmentService: AppointmentService, private customerService: CustomerService, private userService: UserService,) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -89,7 +91,7 @@ export class NewItemComponent implements OnInit {
|
||||
|
||||
const appointment = new Appointment(title, description, startTime.hours, startTime.minutes, endTime.hours, endTime.minutes, correctDate, customer)
|
||||
this.waiting = true
|
||||
this.appointmentService.addAppointment(appointment).subscribe(() => {
|
||||
this.appointmentService.addAppointment(appointment, this.userService.currentCompany.id).subscribe(() => {
|
||||
this.waiting = false
|
||||
this.appointmentAddedEvent.emit(title)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user