Open Zorrow2008 opened 7 years ago
Hi! Can you please provide some more info and post the code?
I am building a Meteor application that will take a search input from the user and use Amazon's itemSearch operation to find and return information about the book( I would like its ISBN, title, and author for now).
I created a Meteor method to do so and when the user enters submit on the search form ,I believe I call the method.
Here is my meteor method code:
Meteor.methods({
itemSearch(title, author) {
console.log("title:" + title);
console.log("author:" + author);
client.itemSearch({
title: title,
author: author,
searchIndex: 'Books',
responseGroup: 'ItemAttributes,Offers,Images,Small'
}).then(function(results){
console.log(results);
}).catch(function(err){
console.log(err);
});
}
});
Here is my javascript code in response to a user submitting the search form:
Template.bookSearch.events({
'submit form' ( event, template ) {
event.preventDefault();
var title = event.target.title.value;
var author = event.target.author.value;
console.log("title = " + title);
console.log("author = " + author);
Meteor.call( 'itemSearch', title, author, ( error, response ) => {
if ( error ) {
Bert.alert( error.reason, 'danger' );
} else {
Bert.alert( 'itemSearch was called', 'success' );
}
});
}
})
I am getting the alert saying that itemSearch was called successfully, so I think I am accessing the api . I don't understand what the error message I'm getting means however.
The code looks good. Can you make sure the credentials are valid?
Can you also print the full error
object? That would be very helpful.
Here's how you can do it http://stackoverflow.com/questions/10729276/how-can-i-get-the-full-object-in-node-jss-console-log-rather-than-object
Hello,
I implemented this meteor package and I am getting this error message.
Why is this occuring? Any help would be appreciated.