vanilli-shop-client
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -27,2 +27,3 @@ import BaseStore from "./base-store"; | ||
private setLastQueryParams; | ||
private initProductSearch; | ||
} |
@@ -84,3 +84,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var notificationStore, lastQueryParams, result, data, e_1; | ||
var notificationStore, result, data, e_1; | ||
return __generator(this, function (_a) { | ||
@@ -90,10 +90,3 @@ switch (_a.label) { | ||
notificationStore = this.notificationStore; | ||
request.additionalProps = this.searchProps; | ||
lastQueryParams = this.lastQueryParams; | ||
if (lastQueryParams) { | ||
queryParams = { | ||
sortBy: lastQueryParams.sortBy, | ||
sortDesc: lastQueryParams.sortDesc | ||
}; | ||
} | ||
queryParams = this.initProductSearch(request, queryParams); | ||
this.toggleProductList(); | ||
@@ -312,2 +305,19 @@ _a.label = 1; | ||
}; | ||
ProductStore.prototype.initProductSearch = function (request, queryParams) { | ||
var lastCategoryId = this.lastSearchRequest.categoryId; | ||
if (lastCategoryId) { | ||
if (!request.categoryId) { | ||
request.categoryId = lastCategoryId; | ||
} | ||
} | ||
request.additionalProps = this.searchProps; | ||
var lastQueryParams = this.lastQueryParams; | ||
if (lastQueryParams) { | ||
queryParams = { | ||
sortBy: lastQueryParams.sortBy, | ||
sortDesc: lastQueryParams.sortDesc | ||
}; | ||
} | ||
return queryParams; | ||
}; | ||
__decorate([ | ||
@@ -314,0 +324,0 @@ mobx_1.observable |
{ | ||
"name": "vanilli-shop-client", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Client for Vanilli Shop API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -36,12 +36,3 @@ import BaseStore from "./base-store"; | ||
const notificationStore = this.notificationStore; | ||
request.additionalProps = this.searchProps; | ||
const lastQueryParams = this.lastQueryParams; | ||
if (lastQueryParams) { | ||
queryParams = { | ||
sortBy: lastQueryParams.sortBy, | ||
sortDesc: lastQueryParams.sortDesc | ||
} | ||
} | ||
queryParams = this.initProductSearch(request, queryParams); | ||
this.toggleProductList(); | ||
@@ -233,2 +224,24 @@ | ||
} | ||
private initProductSearch(request: IProductSearchDto, queryParams?: IQueryParams): IQueryParams | undefined { | ||
const lastCategoryId = this.lastSearchRequest.categoryId; | ||
if (lastCategoryId) { | ||
if (!request.categoryId) { | ||
request.categoryId = lastCategoryId; | ||
} | ||
} | ||
request.additionalProps = this.searchProps; | ||
const lastQueryParams = this.lastQueryParams; | ||
if (lastQueryParams) { | ||
queryParams = { | ||
sortBy: lastQueryParams.sortBy, | ||
sortDesc: lastQueryParams.sortDesc | ||
} | ||
} | ||
return queryParams; | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
243551
5421