Removed test for title + author search
Forgot to remove this
This commit is contained in:
parent
e30db0897d
commit
80cca27bde
1 changed files with 3 additions and 7 deletions
|
|
@ -19,13 +19,9 @@ export class OpenLibraryAPI extends APIModel {
|
||||||
|
|
||||||
async searchByTitle(title: string): Promise<MediaTypeModel[]> {
|
async searchByTitle(title: string): Promise<MediaTypeModel[]> {
|
||||||
console.log(`MDB | api "${this.apiName}" queried by Title`);
|
console.log(`MDB | api "${this.apiName}" queried by Title`);
|
||||||
const titlesplit = title.split("++")
|
|
||||||
if(titlesplit.length !== 1 ){
|
const searchUrl = `https://openlibrary.org/search.json?title=${encodeURIComponent(title)}`;
|
||||||
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 fetchData = await fetch(searchUrl);
|
const fetchData = await fetch(searchUrl);
|
||||||
console.debug(fetchData);
|
console.debug(fetchData);
|
||||||
if (fetchData.status !== 200) {
|
if (fetchData.status !== 200) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue