I want to sent request to Google Books using fetch to find book either by author or by tittle of book.
I don't have the problem to find books by using only one parameter where value is title of book for example:
getData(value) {
console.log(value);
fetch(`https://www.googleapis.com/books/v1/volumes?q=intitle:${value}&printType=books&${myKey}`)
.then(response => response.json())
.then(data => console.log(data))
}
But if I want to use as value either author or tittle of the boks url works wrong. Books are found anly by author:
getData(value) {
console.log(value);
fetch(`https://www.googleapis.com/books/v1/volumes?q=inauthor:${value}&?q=intitle:${value}&printType=books&${myKey}`)
.then(response => response.json())
.then(data => console.log(data))
}
How to built url to fing the bokks either by author or by tittle.