Skip to content

Commit

Permalink
Merge pull request #110 from sinfo/fix-activity-selection
Browse files Browse the repository at this point in the history
fix: can only select one activity of each kind
  • Loading branch information
andreromao authored Feb 26, 2024
2 parents a4bf888 + ce819ca commit 44038e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h5 *ngIf="credentials.lunchTalk">Lunch Talks</h5>
</div> -->


<h6 [innerHTML]="'reservations.info' | translate"></h6>
<h6 *ngIf="credentials.activities.length" [innerHTML]="'reservations.info' | translate"></h6>

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ export class CompanyReservationsComponent implements OnInit, OnDestroy {
if (this.latestReservation.activities === undefined) {
this.latestReservation.activities = [];
}

// FIXME: This is a workaround, imo we should be using dictionaries to store activities
this.latestReservation.activities = this.latestReservation.activities.filter(act => act.kind !== kind);
this.latestReservation.activities.push(new Activity(id, kind));

this.reservationService.setReservation(this.latestReservation);
Expand Down

0 comments on commit 44038e8

Please sign in to comment.