What's the deal with this one.. this gives me the response https://hn.algolia.com/api/v1/search?query=Latest&page=0
fetchSearchTopStories(searchTerm, page = 0){
fetch(`${PATH_BASE}${PATH_SEARCH}?${PARAM_SEARCH}${searchTerm}&${PARAM_PAGE}\
${page}`)
.then(response => response.json())
.then(result => this.setSearchTopStories(result))
.catch(e => {
})
}
but when i do this.. it gives me GET https://hn.algolia.com/api/v1/search?query=Latest&page=${page} and a No 'Access-Control-Allow-Origin' error
fetchSearchTopStories(searchTerm, page = 0){
fetch(`${PATH_BASE}${PATH_SEARCH}?${PARAM_SEARCH}${searchTerm}&${PARAM_PAGE}\${page}`)
.then(response => response.json())
.then(result => this.setSearchTopStories(result))
.catch(e => {
})
}
it's the same code.. the second one ${page} is not in new line the second one gives me the error above.