@builton/node-sdk
Version:
Builton Node SDK.
33 lines (28 loc) • 736 B
JavaScript
const Component = require('./_objects');
const {
get,
refresh,
del,
update,
} = require('./_methods');
class Product extends Component {
constructor(request, props) {
super(request, props, [get, refresh, del, update]);
this.apiPath = 'products';
}
getSubProducts({
size, page, urlParams, json = false,
} = {}, done) {
return this.paginate({
size, page, type: 'get', resource: 'sub_products', urlParams, json,
}, done);
}
searchSubProducts(query, {
size, page, urlParams, json = false,
} = {}, done) {
return this.paginate({
size, page, type: 'get', resource: 'sub_products/search', urlParams: { ...urlParams, query }, json,
}, done);
}
}
module.exports = Product;