goodreads-api-node icon indicating copy to clipboard operation
goodreads-api-node copied to clipboard

You have not passed shelfName

Open louisefindlay23 opened this issue 4 years ago • 0 comments

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

louisefindlay23 avatar Aug 16 '20 16:08 louisefindlay23