diff --git a/angular/src/app/_views/trip/trip-form/trip-form.component.ts b/angular/src/app/_views/trip/trip-form/trip-form.component.ts index 706a9d3..11e2b2d 100644 --- a/angular/src/app/_views/trip/trip-form/trip-form.component.ts +++ b/angular/src/app/_views/trip/trip-form/trip-form.component.ts @@ -39,7 +39,10 @@ export class TripFormComponent extends AbstractDataFormComponent { ) { super( tripForm, - (data: TripJsonld) => this.tripService.tripsPost(data), + (data: TripJsonld) => { + data.completed = false; + return this.tripService.tripsPost(data); + }, (id: string | number, data: TripJsonld) => this.tripService.tripsIdPatch( id.toString(), diff --git a/httpdocs/src/Entity/Trip.php b/httpdocs/src/Entity/Trip.php index b882100..7781991 100644 --- a/httpdocs/src/Entity/Trip.php +++ b/httpdocs/src/Entity/Trip.php @@ -66,6 +66,7 @@ class Trip $this->endLocation = $endLocation; $this->startDate = $startDate; $this->endDate = $endDate; + $this->completed = false; $this->createdAt = new DateTimeImmutable(); $this->tripLocations = new ArrayCollection(); $this->userTrips = new ArrayCollection();