diff --git a/apps/frontend/src/app/poll/choose-events/choose-events.component.html b/apps/frontend/src/app/poll/choose-events/choose-events.component.html index 71abec4b..afc648ce 100644 --- a/apps/frontend/src/app/poll/choose-events/choose-events.component.html +++ b/apps/frontend/src/app/poll/choose-events/choose-events.component.html @@ -46,11 +46,18 @@

You can select up to {{ limit }} choices. } -
- -
+
- @if (pollEvents) { -
- - - - - @for (event of pollEvents; track event) { - - } - - - - - @if (!closedReason) { - - - @for (event of pollEvents; track event) { - - } - - - } - @if (showResults) { - @for (participant of participants; track participant) { - - - @if (participant !== editParticipant) { - @for (pollEvent of pollEvents; track pollEvent; let n = $index) { - - } - } - @if (participant === editParticipant && editDto) { - @for (event of pollEvents; track event) { - - } - } - @if (participant === editParticipant) { - - } - @if (!editParticipant) { - - } - - } - @if (poll?.settings?.showResult !== ShowResultOptions.NEVER || isAdmin) { - - - @for (pollEvent of pollEvents; track pollEvent) { - - } - - - } - } - @if (poll && isAdmin) { - - - @for (pollEvent of pollEvents; track pollEvent; let i = $index) { - - } - - - } - -
- -
- - - - -
- -
-
- {{ poll?.settings?.anonymous ? 'Anonymous' : participant.name }} - @if (participant.createdAt) { - - {{ participant.createdAt | date: 'shortTime' }} - - } - @if (participant.updatedAt !== participant.createdAt) { - - • edited - - } - - @switch (participant.selection[pollEvent._id]) { - @case ('yes') { -
- } - @case ('no') { -
- } - @case ('maybe') { -
- } - @default { -
- } - } -
- - - -
- -
-
- @if (poll?.settings?.allowEdit && token === participant.token) { - - } - @if (isAdmin || token === participant.token) { - - } -
Sum - @if (bestOption === pollEvent.participants) { -
- {{ pollEvent.participants }} -
- } - @if (bestOption !== pollEvent.participants) { -
- {{ pollEvent.participants }} -
- } -
Select Events - - - -
-
+ @if (poll && pollEvents && participants) { + @switch (view$ | async) { + @case ("table") { + + } + @case ("events") { + + } + } }
diff --git a/apps/frontend/src/app/poll/choose-events/choose-events.component.scss b/apps/frontend/src/app/poll/choose-events/choose-events.component.scss index 989ae1a4..bb690f1f 100644 --- a/apps/frontend/src/app/poll/choose-events/choose-events.component.scss +++ b/apps/frontend/src/app/poll/choose-events/choose-events.component.scss @@ -1,34 +1,3 @@ -.table-responsive td, .table-responsive th { - min-width: 100px; -} - -.form-check-hidden { - appearance: none; - cursor: pointer; -} - *:not(:hover) > .hover-info { visibility: hidden; } - -@media (min-width: 768px) { - th:first-child, th:last-child, - td:first-child, td:last-child { - position: sticky; - backdrop-filter: blur(5px); - } - - th:first-child, td:first-child { - background: linear-gradient(90deg, var(--bs-body-bg), rgba(var(--bs-body-bg), 0.75)); - left: 0; - } - - th:last-child, td:last-child { - background: linear-gradient(90deg, rgba(var(--bs-body-bg), 0.75), var(--bs-body-bg)); - right: 0; - } -} - -h5 { - margin: 0; -} diff --git a/apps/frontend/src/app/poll/choose-events/choose-events.component.ts b/apps/frontend/src/app/poll/choose-events/choose-events.component.ts index 7ea325d4..b55cd03d 100644 --- a/apps/frontend/src/app/poll/choose-events/choose-events.component.ts +++ b/apps/frontend/src/app/poll/choose-events/choose-events.component.ts @@ -1,15 +1,13 @@ import {Component, OnInit} from '@angular/core'; import {Meta, Title} from '@angular/platform-browser'; import {ActivatedRoute, Router} from '@angular/router'; -import {checkParticipant} from '@apollusia/logic'; -import {PollEventState} from "@apollusia/types"; import {ShowResultOptions} from '@apollusia/types/lib/schema/show-result-options'; import {ToastService} from '@mean-stream/ngbx'; import {forkJoin} from 'rxjs'; import {map, switchMap, tap} from 'rxjs/operators'; import {MailService, TokenService} from '../../core/services'; -import {CreateParticipantDto, Participant, ReadPoll, ReadPollEvent, UpdateParticipantDto} from '../../model'; +import {Participant, ReadPoll, ReadPollEvent} from '../../model'; import {PollService} from '../services/poll.service'; interface SortMethod { @@ -27,16 +25,20 @@ interface SortMethod { export class ChooseEventsComponent implements OnInit { // initial state poll?: ReadPoll; - pollEvents: ReadPollEvent[] = []; - participants: Participant[] = []; + pollEvents?: ReadPollEvent[]; + participants?: Participant[]; isAdmin: boolean = false; - // aux - bookedEvents: boolean[] = []; + closedReason?: string; + hiddenReason?: string; + bestOption: number = 1; - closedReason?: string = undefined; - hiddenReason?: string = undefined; - showResults = false; + + readonly view$ = this.route.queryParams.pipe(map(({view}) => view ?? 'table')); + readonly views = [ + {id: 'table', name: 'Table', icon: 'bi-table'}, + {id: 'events', name: 'List of Events', icon: 'bi-list-ol'}, + ]; currentSort = 'Created'; currentSortDirection: 1 | -1 = 1; @@ -68,25 +70,12 @@ export class ChooseEventsComponent implements OnInit { name: 'First Event', description: 'View the participants in the order of the events they selected.', defaultDirection: 1, - by: p => this.pollEvents.findIndex(e => p.selection[e._id] === 'yes' || p.selection[e._id] === 'maybe'), + by: p => this.pollEvents?.findIndex(e => p.selection[e._id] === 'yes' || p.selection[e._id] === 'maybe'), }, ] satisfies SortMethod[]; - // view state - newParticipant: CreateParticipantDto = { - name: '', - selection: {}, - token: '', - }; - editParticipant?: Participant; - editDto?: UpdateParticipantDto; - errors: string[] = []; - // helpers - readonly ShowResultOptions = ShowResultOptions; - id: string = ''; url = globalThis.location?.href; - now = Date.now(); mail: string | undefined; token: string; @@ -102,36 +91,27 @@ export class ChooseEventsComponent implements OnInit { ) { this.mail = mailService.getMail(); this.token = tokenService.getToken(); - this.newParticipant.token = this.token; } ngOnInit(): void { this.route.params.pipe( - map(({id}) => this.id = id), - switchMap(id => forkJoin([ + switchMap(({id}) => forkJoin([ this.pollService.get(id).pipe(tap((poll) => { this.poll = poll; this.title.setTitle(`${poll.title} - Apollusia`); this.meta.updateTag({property: 'og:title', content: poll.title}); + this.setDescription(poll); })), - this.pollService.getEvents(id).pipe(tap(events => { - this.pollEvents = events; - this.bookedEvents = new Array(this.pollEvents.length).fill(false); - })), + this.pollService.getEvents(id).pipe(tap(events => this.pollEvents = events)), this.pollService.getParticipants(id).pipe(tap(participants => this.participants = participants)), - this.pollService.isAdmin(id, this.token), + this.pollService.isAdmin(id, this.token).pipe(tap(isAdmin => this.isAdmin = isAdmin)), ])), - ).subscribe(([poll, events, participants, isAdmin]) => { - this.setDescription(poll, events, participants); - this.clearSelection(); - this.validateNew(); - this.bookedEvents = events.map(e => poll.bookedEvents.includes(e._id)); - this.isAdmin = isAdmin; + ).subscribe(() => { this.updateHelpers(); }); } - private setDescription(poll: ReadPoll, events: ReadPollEvent[], participants: Participant[]) { + private setDescription(poll: ReadPoll) { let description = ''; if (poll.description) { description += poll.description + '\n\n'; @@ -146,7 +126,7 @@ export class ChooseEventsComponent implements OnInit { const timeZoneStr = timeZone ? ` (${timeZone})` : ''; description += `📅 Deadline: ${deadline}${timeZoneStr}\n`; } - description += `✅ ${events.length} Option${events.length !== 1 ? 's' : ''} - 👤 ${participants.length} Participant${participants.length !== 1 ? 's' : ''}`; + description += `✅ ${poll.events} Option${poll.events !== 1 ? 's' : ''} - 👤 ${poll.participants} Participant${poll.participants !== 1 ? 's' : ''}`; this.meta.updateTag({name: 'description', content: description}); this.meta.updateTag({property: 'og:description', content: description}); } @@ -157,49 +137,6 @@ export class ChooseEventsComponent implements OnInit { navigator.clipboard.writeText(this.url).then().catch(e => console.log(e)); } - submit() { - this.pollService.participate(this.id, this.newParticipant).subscribe(participant => { - this.participants.unshift(participant); - this.poll && this.poll.participants++; - this.updateHelpers(); - this.clearSelection(); - }, error => { - this.toastService.error('Submit', 'Failed to submit your participation', error); - }); - } - - setEditParticipant(participant: Participant) { - this.editParticipant = participant; - this.editDto = { - selection: {...participant.selection}, - }; - this.validateEdit(); - } - - cancelEdit() { - this.editParticipant = undefined; - } - - confirmEdit() { - if (!this.editParticipant || !this.editDto) { - return; - } - - this.pollService.editParticipant(this.id, this.editParticipant._id, this.editDto).subscribe(participant => { - this.cancelEdit(); - this.participants = this.participants.map(p => p._id === participant._id ? participant : p); - this.updateHelpers(); - }); - } - - deleteParticipation(participantId: string) { - this.pollService.deleteParticipant(this.id, participantId).subscribe(() => { - this.participants = this.participants.filter(p => p._id !== participantId); - this.poll && this.poll.participants--; - this.updateHelpers(); - }); - } - sort(sortMethod: SortMethod) { if (this.currentSort === sortMethod.name) { this.currentSortDirection *= -1; @@ -207,41 +144,13 @@ export class ChooseEventsComponent implements OnInit { this.currentSort = sortMethod.name; this.currentSortDirection = sortMethod.defaultDirection; } - this.participants.sortBy(sortMethod.by, this.currentSortDirection); - } - - book() { - const events = this.pollEvents.filter((e, i) => this.bookedEvents[i]).map(e => e._id); - this.pollService.book(this.id, events).subscribe(() => { - this.toastService.success('Booking', 'Booked events successfully'); - }); - } - - selectAll(state: PollEventState) { - for (const event of this.pollEvents) { - this.newParticipant.selection[event._id] = this.maxParticipantsReached(event) || this.isPastEvent(event) ? undefined : state; - } - } - - validateNew() { - this.errors = checkParticipant(this.newParticipant, this.poll!, this.participants); - } - - validateEdit() { - this.errors = checkParticipant(this.editDto!, this.poll!, this.participants, this.editParticipant!._id); - } - - // View Helpers - // TODO called from template, bad practice - - isPastEvent(event: ReadPollEvent) { - return Date.parse(event.start) < this.now; + this.participants?.sortBy(sortMethod.by, this.currentSortDirection); } // Helpers private updateHelpers() { - this.bestOption = Math.max(...this.pollEvents.map(event => event.participants) || 1); + this.bestOption = Math.max(1, ...this.pollEvents!.map(event => event.participants)); this.updateClosedReason(); this.updateHiddenReason(); } @@ -262,32 +171,16 @@ export class ChooseEventsComponent implements OnInit { switch (this.poll?.settings.showResult) { case ShowResultOptions.NEVER: this.hiddenReason = this.isAdmin ? undefined : 'The results of this poll are hidden. You will only be able to see your own votes.'; - this.showResults = true; break; case ShowResultOptions.AFTER_PARTICIPATING: - this.showResults = this.isAdmin || this.userVoted(); - this.hiddenReason = this.showResults ? undefined : 'This is a blind poll. You can\'t see results or other user\'s votes until you participate yourself.'; + this.hiddenReason = this.isAdmin || this.userVoted() ? undefined : 'This is a blind poll. You can\'t see results or other user\'s votes until you participate yourself.'; break; default: this.hiddenReason = undefined; - this.showResults = true; - } - } - - private clearSelection() { - this.newParticipant.name = this.poll?.settings?.anonymous ? 'Anonymous' : ''; - this.selectAll('no'); - } - - private maxParticipantsReached(event: ReadPollEvent) { - if (!this.poll?.settings.maxEventParticipants) { - return false; } - - return event.participants >= this.poll.settings.maxEventParticipants; } - private userVoted() { - return this.participants.some(participant => participant.token === this.token); + private userVoted(): boolean { + return this.participants?.some(participant => participant.token === this.token) ?? false; } } diff --git a/apps/frontend/src/app/poll/create-poll/create-edit-poll.component.scss b/apps/frontend/src/app/poll/create-poll/create-edit-poll.component.scss index 0f47cfae..e69de29b 100644 --- a/apps/frontend/src/app/poll/create-poll/create-edit-poll.component.scss +++ b/apps/frontend/src/app/poll/create-poll/create-edit-poll.component.scss @@ -1,3 +0,0 @@ -.mwlFlatpickr { - width: 100%; -} diff --git a/apps/frontend/src/app/poll/event-list/event-list.component.html b/apps/frontend/src/app/poll/event-list/event-list.component.html new file mode 100644 index 00000000..dfd55a2a --- /dev/null +++ b/apps/frontend/src/app/poll/event-list/event-list.component.html @@ -0,0 +1,40 @@ +@for (event of pollEvents; track event._id) { +

+ {{ event.start | date:'fullDate' }} at {{ event.start | date:'shortTime' }} - {{ event.end | date:'shortTime' }} + @if (event.note) { + + } + + {{ event.participants }} + +
+ +} diff --git a/apps/frontend/src/app/poll/event-list/event-list.component.scss b/apps/frontend/src/app/poll/event-list/event-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/apps/frontend/src/app/poll/event-list/event-list.component.ts b/apps/frontend/src/app/poll/event-list/event-list.component.ts new file mode 100644 index 00000000..9230cf64 --- /dev/null +++ b/apps/frontend/src/app/poll/event-list/event-list.component.ts @@ -0,0 +1,15 @@ +import {Component, Input} from '@angular/core'; + +import {Participant, ReadPoll, ReadPollEvent} from "../../model"; + +@Component({ + selector: 'apollusia-event-list', + templateUrl: './event-list.component.html', + styleUrl: './event-list.component.scss', +}) +export class EventListComponent { + @Input() poll!: ReadPoll; + @Input() pollEvents!: ReadPollEvent[]; + @Input() participants!: Participant[]; + @Input() bestOption!: number; +} diff --git a/apps/frontend/src/app/poll/participant-info/participant-info.component.html b/apps/frontend/src/app/poll/participant-info/participant-info.component.html new file mode 100644 index 00000000..91e86af4 --- /dev/null +++ b/apps/frontend/src/app/poll/participant-info/participant-info.component.html @@ -0,0 +1,11 @@ +{{ participant.name }} +@if (participant.createdAt) { + + {{ participant.createdAt | date: 'shortTime' }} + +} +@if (participant.updatedAt !== participant.createdAt) { + + • edited + +} diff --git a/apps/frontend/src/app/poll/participant-info/participant-info.component.scss b/apps/frontend/src/app/poll/participant-info/participant-info.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/apps/frontend/src/app/poll/participant-info/participant-info.component.ts b/apps/frontend/src/app/poll/participant-info/participant-info.component.ts new file mode 100644 index 00000000..e4ccde72 --- /dev/null +++ b/apps/frontend/src/app/poll/participant-info/participant-info.component.ts @@ -0,0 +1,12 @@ +import {Component, Input} from '@angular/core'; + +import {Participant} from "../../model"; + +@Component({ + selector: 'apollusia-participant-info', + templateUrl: './participant-info.component.html', + styleUrl: './participant-info.component.scss', +}) +export class ParticipantInfoComponent { + @Input({required: true}) participant: Participant; +} diff --git a/apps/frontend/src/app/poll/poll.module.ts b/apps/frontend/src/app/poll/poll.module.ts index 9856fe4b..4668889c 100644 --- a/apps/frontend/src/app/poll/poll.module.ts +++ b/apps/frontend/src/app/poll/poll.module.ts @@ -12,9 +12,12 @@ import {ChooseDateComponent} from './choose-date/choose-date.component'; import {ChooseEventsComponent} from './choose-events/choose-events.component'; import {CreateEditPollComponent} from './create-poll/create-edit-poll.component'; import {EventHeadComponent} from './event-head/event-head.component'; +import {EventListComponent} from './event-list/event-list.component'; import {MailAlertComponent} from './mail-alert/mail-alert.component'; +import {ParticipantInfoComponent} from './participant-info/participant-info.component'; import {PollRoutingModule} from './poll-routing.module'; import {ChooseDateService} from './services/choose-date.service'; +import {TableComponent} from './table/table.component'; import {CoreModule} from '../core/core.module'; import {AutofillModalComponent, PostponeModalComponent} from '../modals'; import {SomePipe} from '../pipes'; @@ -30,6 +33,9 @@ import {SomePipe} from '../pipes'; EventHeadComponent, CheckButtonComponent, MailAlertComponent, + TableComponent, + EventListComponent, + ParticipantInfoComponent, ], imports: [ CommonModule, @@ -46,9 +52,7 @@ import {SomePipe} from '../pipes'; }), FlatpickrModule.forRoot(), ], - providers: [ - ChooseDateService, - ], + providers: [ChooseDateService], }) export class PollModule { } diff --git a/apps/frontend/src/app/poll/services/poll.service.ts b/apps/frontend/src/app/poll/services/poll.service.ts index f1bd6518..fa652d0b 100644 --- a/apps/frontend/src/app/poll/services/poll.service.ts +++ b/apps/frontend/src/app/poll/services/poll.service.ts @@ -1,5 +1,6 @@ import {HttpClient} from '@angular/common/http'; import {Injectable} from '@angular/core'; +import type {PollEventState} from "@apollusia/types"; import {Observable} from 'rxjs'; import {environment} from '../../../environments/environment'; @@ -15,6 +16,24 @@ export class PollService { ) { } + selectAll(poll: ReadPoll, events: ReadPollEvent[], participant: CreateParticipantDto | UpdateParticipantDto, state: PollEventState) { + for (const event of events) { + participant.selection[event._id] = this.maxParticipantsReached(poll, event) || this.isPastEvent(event) ? undefined : state; + } + } + + maxParticipantsReached(poll: ReadPoll, event: ReadPollEvent) { + if (!poll?.settings.maxEventParticipants) { + return false; + } + + return event.participants >= poll.settings.maxEventParticipants; + } + + isPastEvent(event: ReadPollEvent) { + return Date.parse(event.start) < Date.now(); + } + getOwn(active?: boolean): Observable { return this.http.get(`${environment.backendURL}/poll`, { params: active !== undefined ? { diff --git a/apps/frontend/src/app/poll/table/table.component.html b/apps/frontend/src/app/poll/table/table.component.html new file mode 100644 index 00000000..7e6f404f --- /dev/null +++ b/apps/frontend/src/app/poll/table/table.component.html @@ -0,0 +1,163 @@ +
+ + + + + @for (event of pollEvents; track event) { + + } + + + + + @if (canParticipate) { + + + @for (event of pollEvents; track event) { + + } + + + } + @if (showResults) { + @for (participant of participants; track participant) { + + + @if (participant !== editParticipant) { + @for (pollEvent of pollEvents; track pollEvent; let n = $index) { + + } + + } @else { + @if (editDto) { + @for (event of pollEvents; track event) { + + } + } + + } + + } + + + @for (pollEvent of pollEvents; track pollEvent) { + + } + + + } + @if (poll && isAdmin) { + + + @for (pollEvent of pollEvents; track pollEvent; let i = $index) { + + } + + + } + +
+ +
+ + + + +
+
+ +
+
+ +
+
+
+ + + @switch (participant.selection[pollEvent._id]) { + @case ('yes') { +
+ } + @case ('no') { +
+ } + @case ('maybe') { +
+ } + @default { +
+ } + } +
+ @if (poll.settings.allowEdit && token === participant.token) { + + } + @if (isAdmin || token === participant.token) { + + } + + + + +
+ +
+
Sum +
+ {{ pollEvent.participants }} +
+
Select Events + + + +
+
diff --git a/apps/frontend/src/app/poll/table/table.component.scss b/apps/frontend/src/app/poll/table/table.component.scss new file mode 100644 index 00000000..c946d559 --- /dev/null +++ b/apps/frontend/src/app/poll/table/table.component.scss @@ -0,0 +1,30 @@ +.table-responsive td, .table-responsive th { + min-width: 100px; +} + +.form-check-hidden { + appearance: none; + cursor: pointer; +} + +@media (min-width: 768px) { + th:first-child, th:last-child, + td:first-child, td:last-child { + position: sticky; + backdrop-filter: blur(5px); + } + + th:first-child, td:first-child { + background: linear-gradient(90deg, var(--bs-body-bg), rgba(var(--bs-body-bg), 0.75)); + left: 0; + } + + th:last-child, td:last-child { + background: linear-gradient(90deg, rgba(var(--bs-body-bg), 0.75), var(--bs-body-bg)); + right: 0; + } +} + +h5 { + margin: 0; +} diff --git a/apps/frontend/src/app/poll/table/table.component.ts b/apps/frontend/src/app/poll/table/table.component.ts new file mode 100644 index 00000000..4b1512a7 --- /dev/null +++ b/apps/frontend/src/app/poll/table/table.component.ts @@ -0,0 +1,120 @@ +import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; +import {checkParticipant} from "@apollusia/logic"; +import type {PollEventState} from "@apollusia/types"; +import {ToastService} from "@mean-stream/ngbx"; + +import {CreateParticipantDto, Participant, ReadPoll, ReadPollEvent, UpdateParticipantDto} from "../../model"; +import {PollService} from "../services/poll.service"; + +@Component({ + selector: 'apollusia-table', + templateUrl: './table.component.html', + styleUrl: './table.component.scss', +}) +export class TableComponent implements OnInit { + @Input() poll: ReadPoll; + @Input() pollEvents: ReadPollEvent[] = []; + @Input() participants: Participant[] = []; + @Input() isAdmin: boolean = false; + @Input() canParticipate: boolean = false; + @Input() showResults: boolean = false; + @Input() token: string; + @Input() bestOption: number = 1; + + @Output() changed = new EventEmitter(); + + bookedEvents: boolean[] = []; + + newParticipant: CreateParticipantDto = { + name: '', + selection: {}, + token: '', + }; + editParticipant?: Participant; + editDto?: UpdateParticipantDto; + errors: string[] = []; + + constructor( + protected pollService: PollService, + private toastService: ToastService, + ) { + } + + ngOnInit() { + this.bookedEvents = this.pollEvents.map(e => this.poll.bookedEvents.includes(e._id)); + this.newParticipant.token = this.token; + this.clearSelection(); + this.validateNew(); + } + + submit() { + this.pollService.participate(this.poll._id, this.newParticipant).subscribe(participant => { + this.participants.unshift(participant); + this.poll.participants++; + this.onChange(); + this.clearSelection(); + }, error => { + this.toastService.error('Submit', 'Failed to submit your participation', error); + }); + } + + setEditParticipant(participant: Participant) { + this.editParticipant = participant; + this.editDto = { + selection: {...participant.selection}, + }; + this.validateEdit(); + } + + cancelEdit() { + this.editParticipant = undefined; + } + + confirmEdit() { + if (!this.editParticipant || !this.editDto) { + return; + } + + this.pollService.editParticipant(this.poll._id, this.editParticipant._id, this.editDto).subscribe(participant => { + this.cancelEdit(); + this.participants = this.participants.map(p => p._id === participant._id ? participant : p); + this.onChange(); + }); + } + + deleteParticipation(participantId: string) { + this.pollService.deleteParticipant(this.poll._id, participantId).subscribe(() => { + this.participants = this.participants.filter(p => p._id !== participantId); + this.poll.participants--; + this.onChange(); + }); + } + + validateNew() { + this.errors = checkParticipant(this.newParticipant, this.poll, this.participants); + } + + validateEdit() { + this.errors = checkParticipant(this.editDto!, this.poll, this.participants, this.editParticipant!._id); + } + + clearSelection() { + this.newParticipant.name = this.poll.settings.anonymous ? 'Anonymous' : ''; + this.selectAll('no'); + } + + selectAll(state: PollEventState = 'yes') { + this.pollService.selectAll(this.poll, this.pollEvents, this.newParticipant, state); + } + + book() { + const events = this.pollEvents.filter((e, i) => this.bookedEvents[i]).map(e => e._id); + this.pollService.book(this.poll._id, events).subscribe(() => { + this.toastService.success('Booking', 'Booked events successfully'); + }); + } + + private onChange() { + this.changed.next(); + } +} diff --git a/tsconfig.base.json b/tsconfig.base.json index 7ba19048..11580f31 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -17,7 +17,7 @@ "paths": { "@apollusia/logic": ["libs/types/src/lib/logic/index.ts"], "@apollusia/types": ["libs/types/src/index.ts"], - "@apollusia/types/*": ["libs/types/src/*"], + "@apollusia/types/*": ["libs/types/src/*"] } }, "exclude": ["node_modules", "tmp"]