Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You have not passed shelfName #27

Open
louisefindlay23 opened this issue Aug 16, 2020 · 0 comments
Open

You have not passed shelfName #27

louisefindlay23 opened this issue Aug 16, 2020 · 0 comments

Comments

@louisefindlay23
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant