| @@ -219,18 +219,19 @@ export class TripDetailComponent implements OnInit, AfterViewInit { | |||||
| } | } | ||||
| addNewUserTrip() { | addNewUserTrip() { | ||||
| // Create a new empty user trip with an empty user object as a placeholder | |||||
| const newUserTrip: UserTripJsonld = { | |||||
| // Erstelle ein unvollständiges Objekt (ohne user-Property) | |||||
| const newUserTrip: any = { | |||||
| trip: { | trip: { | ||||
| 'id': this.trip.id | 'id': this.trip.id | ||||
| } as TripJsonld, | } as TripJsonld, | ||||
| user: {} as UserJsonld // Empty user object as placeholder | |||||
| user: null | |||||
| }; | }; | ||||
| this.userTrips.push(newUserTrip); | |||||
| // Füge es als UserTripJsonld hinzu | |||||
| this.userTrips.push(newUserTrip as UserTripJsonld); | |||||
| this.userForms.push(this.createUserForm()); | this.userForms.push(this.createUserForm()); | ||||
| // Force update in the next event loop to properly initialize the search-select | |||||
| // Rest unverändert... | |||||
| setTimeout(() => { | setTimeout(() => { | ||||
| if (this.searchSelects) { | if (this.searchSelects) { | ||||
| const lastSelect = this.searchSelects.last; | const lastSelect = this.searchSelects.last; | ||||