From 0fe9139ddd011bd4115ec8f72313be3f64089bfe Mon Sep 17 00:00:00 2001 From: "aditya.chandel" <> Date: Mon, 30 Dec 2024 22:09:50 -0700 Subject: [PATCH] Add validation for library name --- .../library-creator/library-creator.component.html | 2 +- .../component/library-creator/library-creator.component.ts | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/booklore-ui/src/app/book/component/library-creator/library-creator.component.html b/booklore-ui/src/app/book/component/library-creator/library-creator.component.html index 20a609cb4..86629b781 100644 --- a/booklore-ui/src/app/book/component/library-creator/library-creator.component.html +++ b/booklore-ui/src/app/book/component/library-creator/library-creator.component.html @@ -27,7 +27,7 @@
- +
diff --git a/booklore-ui/src/app/book/component/library-creator/library-creator.component.ts b/booklore-ui/src/app/book/component/library-creator/library-creator.component.ts index 7837381f9..c6dfbefb0 100644 --- a/booklore-ui/src/app/book/component/library-creator/library-creator.component.ts +++ b/booklore-ui/src/app/book/component/library-creator/library-creator.component.ts @@ -10,8 +10,7 @@ import {IconPickerComponent} from '../icon-picker/icon-picker.component'; selector: 'app-library-creator', standalone: false, templateUrl: './library-creator.component.html', - styleUrl: './library-creator.component.scss', - providers: [MessageService] + styleUrl: './library-creator.component.scss' }) export class LibraryCreatorComponent { @@ -96,7 +95,7 @@ export class LibraryCreatorComponent { this.dynamicDialogRef.close(); } - validateLibraryNameAndProceed(nextCallback: any) { + validateLibraryNameAndProceed(activateCallback: Function) { if (this.libraryName.trim()) { this.libraryService.libraryState$.subscribe( libraryState => { @@ -108,7 +107,7 @@ export class LibraryCreatorComponent { detail: 'This library name is already taken.', }); } else { - nextCallback(); + activateCallback(2); } } )