Interfaces/show: make id optional
This commit is contained in:
parent
ee6ebfd98c
commit
92360fdad9
2 changed files with 14 additions and 11 deletions
|
|
@ -72,17 +72,19 @@ export class ShowsComponent {
|
|||
modal.result.then(
|
||||
(result) => {
|
||||
if (result) {
|
||||
this.api.deleteShw(show._id).subscribe({
|
||||
next: (response: ShowsApiDeletion) => {
|
||||
// Do nothing
|
||||
}, error: (err: any) => {
|
||||
console.log(err)
|
||||
}, complete: () => {
|
||||
this.toastService.show({body: "Show deleted!"})
|
||||
this.shows = this.shows.filter(((s: Show) => s != show))
|
||||
if (show._id != null) {
|
||||
this.api.deleteShw(show._id).subscribe({
|
||||
next: (response: ShowsApiDeletion) => {
|
||||
// Do nothing
|
||||
}, error: (err: any) => {
|
||||
console.log(err)
|
||||
}, complete: () => {
|
||||
this.toastService.show({body: "Show deleted!"})
|
||||
this.shows = this.shows.filter(((s: Show) => s != show))
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
(result) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue