From 80cca27bdef6ba38b8f3ed2223cdf612d8b2bea5 Mon Sep 17 00:00:00 2001 From: ltctceplrm <14954927+ltctceplrm@users.noreply.github.com> Date: Thu, 21 Dec 2023 20:35:59 +0100 Subject: [PATCH] Removed test for title + author search Forgot to remove this --- src/api/apis/OpenLibraryAPI.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/api/apis/OpenLibraryAPI.ts b/src/api/apis/OpenLibraryAPI.ts index e2ba01d..4591b14 100644 --- a/src/api/apis/OpenLibraryAPI.ts +++ b/src/api/apis/OpenLibraryAPI.ts @@ -19,13 +19,9 @@ export class OpenLibraryAPI extends APIModel { async searchByTitle(title: string): Promise { console.log(`MDB | api "${this.apiName}" queried by Title`); - const titlesplit = title.split("++") - if(titlesplit.length !== 1 ){ - var searchUrl = `https://openlibrary.org/search.json?title=${encodeURIComponent(titlesplit[0])}&author=${encodeURIComponent(titlesplit[1])}`; - } - else{ - var searchUrl = `https://openlibrary.org/search.json?title=${encodeURIComponent(title)}`; - } + + const searchUrl = `https://openlibrary.org/search.json?title=${encodeURIComponent(title)}`; + const fetchData = await fetch(searchUrl); console.debug(fetchData); if (fetchData.status !== 200) {