Skip to content

You have not passed shelfName #27

Description

@louisefindlay23

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions