From 41666cc6a313cd1c1873e835698c5d2d211570d2 Mon Sep 17 00:00:00 2001 From: X4Lo Date: Tue, 10 Sep 2024 01:19:17 +0100 Subject: [PATCH] add fetch entry collection + change to seen modals & improvements --- .../src/app/core/services/entry.service.ts | 6 + .../entry-page/entry-page.component.html | 8 +- .../entry/entry-page/entry-page.component.ts | 70 +++++---- .../episode-seen-modal.component.html | 2 +- .../episode-seen-modal.component.ts | 136 +++++++++++++----- .../seen-modal/seen-modal.component.html | 9 +- .../modals/seen-modal/seen-modal.component.ts | 22 +-- 7 files changed, 171 insertions(+), 82 deletions(-) diff --git a/frontend/src/app/core/services/entry.service.ts b/frontend/src/app/core/services/entry.service.ts index fc24b93..810c740 100644 --- a/frontend/src/app/core/services/entry.service.ts +++ b/frontend/src/app/core/services/entry.service.ts @@ -69,6 +69,12 @@ export class EntryService { ); } + fetchEntryCollectionById(entryId: number) { + return this.http.get( + `${this.backend_apiUrl}/${this.apiAction}/${entryId}/fetch-collection` + ); + } + // delete entry removeEntryById(entryId: string) { return this.http.delete( diff --git a/frontend/src/app/features/entry/entry-page/entry-page.component.html b/frontend/src/app/features/entry/entry-page/entry-page.component.html index b42a3ec..d474494 100644 --- a/frontend/src/app/features/entry/entry-page/entry-page.component.html +++ b/frontend/src/app/features/entry/entry-page/entry-page.component.html @@ -161,6 +161,12 @@ + + -
+
- +
- +
diff --git a/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.ts b/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.ts index bd1fa41..748c5a3 100644 --- a/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.ts +++ b/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.ts @@ -48,18 +48,22 @@ export class SeenModalComponent implements OnInit { this.watchDate = formatDate(new Date(), 'yyyy-MM-dd', 'en-US'); } else { // ? if data is passed, populate fields - this.watchDate = formatDate(new Date(this.data.watchDate), 'yyyy-MM-dd', 'en-US'); + this.watchDate = formatDate( + new Date(this.data.watchDate), + 'yyyy-MM-dd', + 'en-US' + ); this.watchedWith = this.data.watchedWith.split(', ').join('\n'); } - flatpickr('#myDatepicker', { - inline: true, - defaultDate: this.watchDate, - altInput: true, - allowInput: false, - altFormat: 'F j, Y', - dateFormat: 'Y-m-d', - }); + // flatpickr('#myDatepicker', { + // inline: true, + // defaultDate: this.watchDate, + // altInput: true, + // allowInput: false, + // altFormat: 'F j, Y', + // dateFormat: 'Y-m-d', + // }); } onConfirm(): void {