From 312fedec7b2a5846cf44edd1318c6d466ea4b806 Mon Sep 17 00:00:00 2001 From: Toast Date: Thu, 6 Feb 2025 10:46:27 +0100 Subject: [PATCH] Pages/shows: add functionality to edit button --- src/pages/shows/shows.component.html | 2 +- src/pages/shows/shows.component.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pages/shows/shows.component.html b/src/pages/shows/shows.component.html index 924e8b1..8f6cc94 100644 --- a/src/pages/shows/shows.component.html +++ b/src/pages/shows/shows.component.html @@ -9,7 +9,7 @@ - diff --git a/src/pages/shows/shows.component.ts b/src/pages/shows/shows.component.ts index 31a9b9c..2415bb8 100644 --- a/src/pages/shows/shows.component.ts +++ b/src/pages/shows/shows.component.ts @@ -82,4 +82,15 @@ export class ShowsComponent { } ) } + + editShow(show: Show, index: number) { + const modal: NgbModalRef = this.modalService.open(CreateEditModalComponent) + modal.componentInstance.editMode = true + modal.componentInstance.show = show + modal.componentInstance.initForm() + modal.result.then( + (closeResult: Show) => {this.shows[index] = closeResult}, + (dissmissResult) => {} + ) + } }