I'm trying to use gr.addBookToShelf() by keeping getting the error You have not passed shelfName. I used the default shelf, read and have tried other shelves such as to-read but the promise keeps being rejected.
I noticed there was a small typo in the readme. It should be gr.addBookToShelf() rather than gr.addBooksToShelf() which caught me out.
app.get('/book/add', function (req, res) {
var addbook = gr.addBookToShelf({
bookID: req.query.id,
shelfName: "read"
});
addbook.then(function (result) {
console.log(result);
res.redirect("/");
}).catch(function (err) {
console.log("Adding book rejected" + err);
});
});
Git Branch
I'm trying to use
gr.addBookToShelf()by keeping getting the errorYou have not passed shelfName. I used the default shelf, read and have tried other shelves such as to-read but the promise keeps being rejected.I noticed there was a small typo in the readme. It should be
gr.addBookToShelf()rather thangr.addBooksToShelf()which caught me out.Git Branch