Improve searching

This commit is contained in:
aditya.chandel
2024-12-13 16:05:04 -07:00
parent 1e9249b257
commit 033fc95373
5 changed files with 26 additions and 8 deletions
@@ -31,7 +31,7 @@ export class BookService {
}
searchBooks(query: string): Observable<Book[]> {
if (query.length < 3) {
if (query.length < 2) {
return new Observable<Book[]>();
}
return this.http.get<Book[]>(`${this.bookUrl}/search?title=${encodeURIComponent(query)}`);