Skip to content

Commit

Permalink
enabled passing params when querying on Store resources
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Jan 11, 2022
1 parent 86f4b99 commit 9f5ba7a
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/@fleetbase/storefront.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/@fleetbase/storefront.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/storefront.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/storefront.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/storefront.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/storefront.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/storefront",
"version": "1.1.3",
"version": "1.1.4",
"description": "Fleetbase Storefront JS & Node SDK",
"main": "dist/cjs/storefront.js",
"module": "dist/esm/storefront.js",
Expand Down
12 changes: 6 additions & 6 deletions src/resources/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ export default class Store extends Resource {
super(attributes, adapter, 'store', options);
}

getReviews() {
return this.adapter.get('reviews', { store: this.id }).then((reviews) => {
getReviews(params = {}) {
return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {
return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));
});
}

getLocations() {
return this.adapter.get('locations', { store: this.id }).then((storeLocations) => {
getLocations(params = {}) {
return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {
return new Collection(
storeLocations.map((attributes) => {
if (attributes.place) {
Expand All @@ -35,8 +35,8 @@ export default class Store extends Resource {
});
}

getPaymentGateways() {
return this.adapter.get('gateways').then((gateways) => {
getPaymentGateways(params = {}) {
return this.adapter.get('gateways', params).then((gateways) => {
return new Collection(
gateways.map((attributes) => {
return new PaymentGateway(attributes, this.adapter);
Expand Down

0 comments on commit 9f5ba7a

Please sign in to comment.