Skip to content

Commit

Permalink
v0.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mastashake08 committed Jan 20, 2023
1 parent 66050e2 commit 8348dcc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class Gutendex {
async getBook (id) {
try {
const res = await fetch(this.baseUrl + `/${id}`)
return res
return await res.json()
} catch (e) {
alert(`${e.name} - ${e.message}`)
}
Expand All @@ -34,7 +34,7 @@ export default class Gutendex {
async getBooksByIds (ids) {
try {
const res = await fetch(this.baseUrl + `?ids=${ids}`)
return res
return await res.json()
} catch (e) {
alert(`${e.name} - ${e.message}`)
}
Expand All @@ -43,7 +43,7 @@ export default class Gutendex {
async getBooksByTopic (topic) {
try {
const res = await fetch(this.baseUrl + `?topic=${topic}`)
return res
return await res.json()
} catch (e) {
alert(`${e.name} - ${e.message}`)
}
Expand All @@ -52,7 +52,7 @@ export default class Gutendex {
async getBooksByTerm (term) {
try {
const res = await fetch(this.baseUrl + `?search=${topic}`)
return res
return await res.json()
} catch (e) {
alert(`${e.name} - ${e.message}`)
}
Expand All @@ -61,7 +61,7 @@ export default class Gutendex {
async getBooksByMimeType (type) {
try {
const res = await fetch(this.baseUrl + `?mime_type=${type}`)
return res
return await res.json()
} catch (e) {
alert(`${e.name} - ${e.message}`)
}
Expand All @@ -70,7 +70,7 @@ export default class Gutendex {
async readBook (id) {
try {
const res = await fetch(this.baseUrl + `/${id}?mime_type=text%2F`)
return res
return await res.json()
} catch (e) {
alert(`${e.name} - ${e.message}`)
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gutendex",
"version": "0.0.7",
"version": "0.0.8",
"description": "npm package for interacting with the Project Gutenberg ebook metadata catalog using the Gutendex API. Can be sel-hosted or cloud.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 8348dcc

Please sign in to comment.