Skip to content

Commit ceffff9

Browse files
devmeghpajaydev
authored andcommitted
Support to search with different type (#66)
Possible types : ISBN, UPC, EAN, or ReferenceID Default : ReferenceID
1 parent 31fdf38 commit ceffff9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/findingApi.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ const getVersion = function () {
7373
const findItemsByProduct = function (options) {
7474
if (!options) throw new Error('INVALID_REQUEST_PARMS --> Please enter the Valid input.');
7575
if (!options.productId) throw new Error('INVALID_REQUEST_PARMS --> Product ID is required.');
76+
let type = options.type ? options.type : 'ReferenceID';
7677
this.options.operationName = 'findItemsByProduct';
7778
this.options.additionalParam = constructAdditionalParams(options);
7879
let url = urlObject.buildSearchUrl(this.options);
79-
url = `${url}&productId.@type=ReferenceID`;
80+
url = `${url}&productId.@type=${type}`;
8081
return getRequest(url).then((data) => {
8182
return JSON.parse(data).findItemsByProductResponse;
8283

0 commit comments

Comments
 (0)