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 { 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 title: string
date: Date date: Date
seasons: number seasons: number

View file

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