Interfaces/show: make id optional

This commit is contained in:
Toast 2025-02-05 02:20:40 +01:00
parent ee6ebfd98c
commit 92360fdad9
2 changed files with 14 additions and 11 deletions

View file

@ -1,5 +1,6 @@
export interface Show {
_id: string
// ID is assigned by the DB, so I don't want to have to specify it
_id?: string
title: string
date: Date
seasons: number

View file

@ -72,6 +72,7 @@ export class ShowsComponent {
modal.result.then(
(result) => {
if (result) {
if (show._id != null) {
this.api.deleteShw(show._id).subscribe({
next: (response: ShowsApiDeletion) => {
// Do nothing
@ -84,6 +85,7 @@ export class ShowsComponent {
}
)
}
}
},
(result) => {
// Dismissed, do nothing