Skip to content

Commit

Permalink
generic search
Browse files Browse the repository at this point in the history
  • Loading branch information
mastashake08 committed Jan 20, 2023
1 parent 2c5eb50 commit 548114f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions classes/Gutendex.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ class Gutendex {
alert(`${e.name} - ${e.message}`)
}
}

async getBooksByTerm (term) {
try {
const res = await fetch(this.baseUrl + `?search=${topic}`)
return res
} catch (e) {
alert(`${e.name} - ${e.message}`)
}
}
}

export { Gutendex }

0 comments on commit 548114f

Please sign in to comment.