chore(ui): clear eslint optional chain assertion bucket
Replace non-null assertions on optional chains in the library and shelf menu actions with direct entity assertions so the commands keep their current assumptions without tripping the stricter TypeScript lint rule. Validation: just ui lint
This commit is contained in:
@@ -85,7 +85,7 @@ export class LibraryShelfMenuService {
|
||||
severity: 'success',
|
||||
},
|
||||
accept: () => {
|
||||
this.libraryService.refreshLibrary(entity?.id!).subscribe({
|
||||
this.libraryService.refreshLibrary(entity!.id).subscribe({
|
||||
complete: () => {
|
||||
this.messageService.add({severity: 'info', summary: this.t.translate('common.success'), detail: this.t.translate('book.shelfMenuService.toast.libraryRefreshSuccessDetail')});
|
||||
},
|
||||
@@ -148,7 +148,7 @@ export class LibraryShelfMenuService {
|
||||
accept: () => {
|
||||
const loader = this.loadingService.show(this.t.translate('book.shelfMenuService.loading.deletingLibrary', {name: entity?.name}));
|
||||
|
||||
this.libraryService.deleteLibrary(entity?.id!)
|
||||
this.libraryService.deleteLibrary(entity!.id)
|
||||
.pipe(finalize(() => this.loadingService.hide(loader)))
|
||||
.subscribe({
|
||||
complete: () => {
|
||||
@@ -212,7 +212,7 @@ export class LibraryShelfMenuService {
|
||||
severity: 'secondary'
|
||||
},
|
||||
accept: () => {
|
||||
this.shelfService.deleteShelf(entity?.id!).subscribe({
|
||||
this.shelfService.deleteShelf(entity!.id).subscribe({
|
||||
complete: () => {
|
||||
this.router.navigate(['/']);
|
||||
this.messageService.add({severity: 'info', summary: this.t.translate('common.success'), detail: this.t.translate('book.shelfMenuService.toast.shelfDeletedDetail')});
|
||||
@@ -284,7 +284,7 @@ export class LibraryShelfMenuService {
|
||||
severity: 'secondary'
|
||||
},
|
||||
accept: () => {
|
||||
this.magicShelfService.deleteShelf(entity?.id!).subscribe({
|
||||
this.magicShelfService.deleteShelf(entity!.id).subscribe({
|
||||
complete: () => {
|
||||
this.router.navigate(['/']);
|
||||
this.messageService.add({severity: 'info', summary: this.t.translate('common.success'), detail: this.t.translate('book.shelfMenuService.toast.magicShelfDeletedDetail')});
|
||||
|
||||
Reference in New Issue
Block a user