-
Notifications
You must be signed in to change notification settings - Fork 75
Description
@doverradio reported
Hi, I tried using the filters in FindItemsByCategory in this way
ebay.findItemsByCategory({
categoryID: 10181,
}).then((data) => {
// console.log(data);
console.log(data[0].errorMessage[0].error[0].message[0]);
}, (error) => {
console.log(error);
});
but got error Invalid category ID.
How can I pass in filters on this call?
If I deviate from your example it constantly fails but I need to specify show sold only and price range.
After I checked your source code, perhaps you could replace the current function with this to the function:
const findItemsByCategory = function (options) {
let categoryID = options.categoryID;
if (!options.categoryID) throw new Error('INVALID_REQUEST_PARMS --> Category ID is null or invalid');
this.options.name = categoryID;
this.options.operationName = FIND_ITEMS_BY_CATEGORY;
this.options.param = 'categoryId';
this.options.additionalParam = constructAdditionalParams(options);
const url = urlObject.buildSearchUrl(this.options);
return getRequest(url).then((data) => {
return JSON.parse(data).findItemsByCategoryResponse;
}, console.error // eslint-disable-line no-console
);
};
After applying the above, my code now works using that.