fix betreft afspraken
All checks were successful
Docker Image CI / build-and-push (push) Successful in 1m4s
Docker Image CI / deploy (push) Successful in 30s
Docker Image CI / notify-failure (push) Has been skipped

This commit is contained in:
2025-04-18 23:30:16 +02:00
parent 781723fddf
commit 524aa879de
9 changed files with 50 additions and 33 deletions

View File

@@ -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)
})