@ikas/storefront 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.es.js
CHANGED
|
@@ -10951,11 +10951,11 @@ var IkasProductListPropValueProvider = /** @class */ (function () {
|
|
|
10951
10951
|
if (this.productListPropValue.usePageFilter) {
|
|
10952
10952
|
if (this.pageType === IkasThemePageType.CATEGORY) {
|
|
10953
10953
|
category = this.pageSpecificData;
|
|
10954
|
-
filters.category = category.
|
|
10954
|
+
filters.category = category.id;
|
|
10955
10955
|
}
|
|
10956
10956
|
else if (this.pageType === IkasThemePageType.BRAND) {
|
|
10957
10957
|
brand = this.pageSpecificData;
|
|
10958
|
-
filters.brand = brand.
|
|
10958
|
+
filters.brand = brand.id;
|
|
10959
10959
|
}
|
|
10960
10960
|
}
|
|
10961
10961
|
}
|
|
@@ -14136,9 +14136,10 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
14136
14136
|
var IkasProductListFilter = /** @class */ (function () {
|
|
14137
14137
|
function IkasProductListFilter(data) {
|
|
14138
14138
|
if (data === void 0) { data = {}; }
|
|
14139
|
-
// /collections/slug ve /brands/slug sayfalarında bunlar sabit filtre olacak
|
|
14140
14139
|
this.category = null;
|
|
14141
14140
|
this.brand = null;
|
|
14141
|
+
this.category = data.category || null;
|
|
14142
|
+
this.brand = data.brand || null;
|
|
14142
14143
|
this.categories = data.categories || [];
|
|
14143
14144
|
this.brands = data.brands || [];
|
|
14144
14145
|
this.variantValues = data.variantValues || [];
|
|
@@ -14161,16 +14162,16 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14161
14162
|
this.getInitial = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
14162
14163
|
var page, limit, response_1, data_1, err_1;
|
|
14163
14164
|
var _this = this;
|
|
14164
|
-
var _a;
|
|
14165
|
-
return __generator(this, function (
|
|
14166
|
-
switch (
|
|
14165
|
+
var _a, _b, _c;
|
|
14166
|
+
return __generator(this, function (_d) {
|
|
14167
|
+
switch (_d.label) {
|
|
14167
14168
|
case 0:
|
|
14168
14169
|
if (this._isLoading)
|
|
14169
14170
|
return [2 /*return*/];
|
|
14170
14171
|
this._isLoading = true;
|
|
14171
|
-
|
|
14172
|
+
_d.label = 1;
|
|
14172
14173
|
case 1:
|
|
14173
|
-
|
|
14174
|
+
_d.trys.push([1, 3, 4, 5]);
|
|
14174
14175
|
page = this._page;
|
|
14175
14176
|
limit = this._limit;
|
|
14176
14177
|
if (this.isStatic) {
|
|
@@ -14192,9 +14193,12 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14192
14193
|
? (_a = this._productListPropValue.productIds) === null || _a === void 0 ? void 0 : _a.map(function (p) { return p.productId; }) : undefined,
|
|
14193
14194
|
page: page,
|
|
14194
14195
|
limit: limit,
|
|
14196
|
+
brandId: ((_b = this._filters) === null || _b === void 0 ? void 0 : _b.brand) ? this._filters.brand : undefined,
|
|
14197
|
+
categoryIds: ((_c = this._filters) === null || _c === void 0 ? void 0 : _c.category) ? [this._filters.category]
|
|
14198
|
+
: undefined,
|
|
14195
14199
|
})];
|
|
14196
14200
|
case 2:
|
|
14197
|
-
response_1 =
|
|
14201
|
+
response_1 = _d.sent();
|
|
14198
14202
|
data_1 = [];
|
|
14199
14203
|
if (this.isStatic) {
|
|
14200
14204
|
data_1 = this._productListPropValue.productIds.map(function (pID) {
|
|
@@ -14216,7 +14220,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14216
14220
|
});
|
|
14217
14221
|
return [3 /*break*/, 5];
|
|
14218
14222
|
case 3:
|
|
14219
|
-
err_1 =
|
|
14223
|
+
err_1 = _d.sent();
|
|
14220
14224
|
console.log(err_1);
|
|
14221
14225
|
return [3 /*break*/, 5];
|
|
14222
14226
|
case 4:
|
|
@@ -14231,9 +14235,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14231
14235
|
this.getPrev = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
14232
14236
|
var minPage_1, response_2, data_2, err_2;
|
|
14233
14237
|
var _this = this;
|
|
14234
|
-
var _a;
|
|
14235
|
-
return __generator(this, function (
|
|
14236
|
-
switch (
|
|
14238
|
+
var _a, _b, _c;
|
|
14239
|
+
return __generator(this, function (_d) {
|
|
14240
|
+
switch (_d.label) {
|
|
14237
14241
|
case 0:
|
|
14238
14242
|
if (this.isStatic ||
|
|
14239
14243
|
this.isDiscounted ||
|
|
@@ -14242,18 +14246,21 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14242
14246
|
!this.hasPrev)
|
|
14243
14247
|
return [2 /*return*/];
|
|
14244
14248
|
this._isLoading = true;
|
|
14245
|
-
|
|
14249
|
+
_d.label = 1;
|
|
14246
14250
|
case 1:
|
|
14247
|
-
|
|
14251
|
+
_d.trys.push([1, 3, 4, 5]);
|
|
14248
14252
|
minPage_1 = this._minPage - 1;
|
|
14249
14253
|
return [4 /*yield*/, IkasProductAPI.listProducts({
|
|
14250
14254
|
idList: this.isStatic
|
|
14251
14255
|
? (_a = this._productListPropValue.productIds) === null || _a === void 0 ? void 0 : _a.map(function (p) { return p.productId; }) : undefined,
|
|
14252
14256
|
page: minPage_1,
|
|
14253
14257
|
limit: this._limit,
|
|
14258
|
+
brandId: ((_b = this._filters) === null || _b === void 0 ? void 0 : _b.brand) ? this._filters.brand : undefined,
|
|
14259
|
+
categoryIds: ((_c = this._filters) === null || _c === void 0 ? void 0 : _c.category) ? [this._filters.category]
|
|
14260
|
+
: undefined,
|
|
14254
14261
|
})];
|
|
14255
14262
|
case 2:
|
|
14256
|
-
response_2 =
|
|
14263
|
+
response_2 = _d.sent();
|
|
14257
14264
|
data_2 = response_2.products.map(function (product) {
|
|
14258
14265
|
return new IkasProductDetail(product, product.variants[0].variantValues);
|
|
14259
14266
|
});
|
|
@@ -14264,7 +14271,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14264
14271
|
});
|
|
14265
14272
|
return [3 /*break*/, 5];
|
|
14266
14273
|
case 3:
|
|
14267
|
-
err_2 =
|
|
14274
|
+
err_2 = _d.sent();
|
|
14268
14275
|
console.log(err_2);
|
|
14269
14276
|
return [3 /*break*/, 5];
|
|
14270
14277
|
case 4:
|
|
@@ -14279,8 +14286,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14279
14286
|
this.getNext = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
14280
14287
|
var response_3, data_3, err_3;
|
|
14281
14288
|
var _this = this;
|
|
14282
|
-
|
|
14283
|
-
|
|
14289
|
+
var _a, _b;
|
|
14290
|
+
return __generator(this, function (_c) {
|
|
14291
|
+
switch (_c.label) {
|
|
14284
14292
|
case 0:
|
|
14285
14293
|
if (this.isStatic ||
|
|
14286
14294
|
this.isDiscounted ||
|
|
@@ -14289,15 +14297,18 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14289
14297
|
!this.hasNext)
|
|
14290
14298
|
return [2 /*return*/];
|
|
14291
14299
|
this._isLoading = true;
|
|
14292
|
-
|
|
14300
|
+
_c.label = 1;
|
|
14293
14301
|
case 1:
|
|
14294
|
-
|
|
14302
|
+
_c.trys.push([1, 3, 4, 5]);
|
|
14295
14303
|
return [4 /*yield*/, IkasProductAPI.listProducts({
|
|
14296
14304
|
page: this.page + 1,
|
|
14297
14305
|
limit: this.limit,
|
|
14306
|
+
brandId: ((_a = this._filters) === null || _a === void 0 ? void 0 : _a.brand) ? this._filters.brand : undefined,
|
|
14307
|
+
categoryIds: ((_b = this._filters) === null || _b === void 0 ? void 0 : _b.category) ? [this._filters.category]
|
|
14308
|
+
: undefined,
|
|
14298
14309
|
})];
|
|
14299
14310
|
case 2:
|
|
14300
|
-
response_3 =
|
|
14311
|
+
response_3 = _c.sent();
|
|
14301
14312
|
data_3 = response_3.products.map(function (product) {
|
|
14302
14313
|
return new IkasProductDetail(product, product.variants[0].variantValues);
|
|
14303
14314
|
});
|
|
@@ -14308,7 +14319,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14308
14319
|
});
|
|
14309
14320
|
return [3 /*break*/, 5];
|
|
14310
14321
|
case 3:
|
|
14311
|
-
err_3 =
|
|
14322
|
+
err_3 = _c.sent();
|
|
14312
14323
|
console.log(err_3);
|
|
14313
14324
|
return [3 /*break*/, 5];
|
|
14314
14325
|
case 4:
|
|
@@ -14323,8 +14334,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14323
14334
|
this.getPage = function (page) { return __awaiter(_this, void 0, void 0, function () {
|
|
14324
14335
|
var response_4, data_4, err_4;
|
|
14325
14336
|
var _this = this;
|
|
14326
|
-
|
|
14327
|
-
|
|
14337
|
+
var _a, _b;
|
|
14338
|
+
return __generator(this, function (_c) {
|
|
14339
|
+
switch (_c.label) {
|
|
14328
14340
|
case 0:
|
|
14329
14341
|
if (this._isLoading ||
|
|
14330
14342
|
this.isStatic ||
|
|
@@ -14332,15 +14344,18 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14332
14344
|
this.isRecommended)
|
|
14333
14345
|
return [2 /*return*/];
|
|
14334
14346
|
this._isLoading = true;
|
|
14335
|
-
|
|
14347
|
+
_c.label = 1;
|
|
14336
14348
|
case 1:
|
|
14337
|
-
|
|
14349
|
+
_c.trys.push([1, 3, 4, 5]);
|
|
14338
14350
|
return [4 /*yield*/, IkasProductAPI.listProducts({
|
|
14339
14351
|
page: this.page + 1,
|
|
14340
14352
|
limit: this.limit,
|
|
14353
|
+
brandId: ((_a = this._filters) === null || _a === void 0 ? void 0 : _a.brand) ? this._filters.brand : undefined,
|
|
14354
|
+
categoryIds: ((_b = this._filters) === null || _b === void 0 ? void 0 : _b.category) ? [this._filters.category]
|
|
14355
|
+
: undefined,
|
|
14341
14356
|
})];
|
|
14342
14357
|
case 2:
|
|
14343
|
-
response_4 =
|
|
14358
|
+
response_4 = _c.sent();
|
|
14344
14359
|
data_4 = response_4.products.map(function (product) {
|
|
14345
14360
|
return new IkasProductDetail(product, product.variants[0].variantValues);
|
|
14346
14361
|
});
|
|
@@ -14352,7 +14367,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14352
14367
|
});
|
|
14353
14368
|
return [3 /*break*/, 5];
|
|
14354
14369
|
case 3:
|
|
14355
|
-
err_4 =
|
|
14370
|
+
err_4 = _c.sent();
|
|
14356
14371
|
console.log(err_4);
|
|
14357
14372
|
return [3 /*break*/, 5];
|
|
14358
14373
|
case 4:
|
|
@@ -19325,7 +19340,7 @@ var IkasProductAPI = /** @class */ (function () {
|
|
|
19325
19340
|
return __generator(this, function (_b) {
|
|
19326
19341
|
switch (_b.label) {
|
|
19327
19342
|
case 0:
|
|
19328
|
-
LIST_PRODUCTS = src(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n brandId\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "], ["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n brandId\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "])));
|
|
19343
|
+
LIST_PRODUCTS = src(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n $brandId: StringFilterInput\n $categoryIds: StringFilterInput\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n brandId: $brandId\n categoryIds: $categoryIds\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n brandId\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "], ["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n $brandId: StringFilterInput\n $categoryIds: StringFilterInput\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n brandId: $brandId\n categoryIds: $categoryIds\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n brandId\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "])));
|
|
19329
19344
|
_b.label = 1;
|
|
19330
19345
|
case 1:
|
|
19331
19346
|
_b.trys.push([1, 9, , 10]);
|
|
@@ -19343,6 +19358,16 @@ var IkasProductAPI = /** @class */ (function () {
|
|
|
19343
19358
|
limit: params.limit || 10,
|
|
19344
19359
|
};
|
|
19345
19360
|
}
|
|
19361
|
+
if (params === null || params === void 0 ? void 0 : params.brandId) {
|
|
19362
|
+
variables.brandId = {
|
|
19363
|
+
eq: params.brandId,
|
|
19364
|
+
};
|
|
19365
|
+
}
|
|
19366
|
+
if ((params === null || params === void 0 ? void 0 : params.categoryIds) && params.categoryIds.length) {
|
|
19367
|
+
variables.categoryIds = {
|
|
19368
|
+
in: params.categoryIds,
|
|
19369
|
+
};
|
|
19370
|
+
}
|
|
19346
19371
|
return [4 /*yield*/, apollo
|
|
19347
19372
|
.getClient()
|
|
19348
19373
|
.query({
|
package/build/index.js
CHANGED
|
@@ -10964,11 +10964,11 @@ var IkasProductListPropValueProvider = /** @class */ (function () {
|
|
|
10964
10964
|
if (this.productListPropValue.usePageFilter) {
|
|
10965
10965
|
if (this.pageType === exports.IkasThemePageType.CATEGORY) {
|
|
10966
10966
|
category = this.pageSpecificData;
|
|
10967
|
-
filters.category = category.
|
|
10967
|
+
filters.category = category.id;
|
|
10968
10968
|
}
|
|
10969
10969
|
else if (this.pageType === exports.IkasThemePageType.BRAND) {
|
|
10970
10970
|
brand = this.pageSpecificData;
|
|
10971
|
-
filters.brand = brand.
|
|
10971
|
+
filters.brand = brand.id;
|
|
10972
10972
|
}
|
|
10973
10973
|
}
|
|
10974
10974
|
}
|
|
@@ -14122,9 +14122,10 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
14122
14122
|
var IkasProductListFilter = /** @class */ (function () {
|
|
14123
14123
|
function IkasProductListFilter(data) {
|
|
14124
14124
|
if (data === void 0) { data = {}; }
|
|
14125
|
-
// /collections/slug ve /brands/slug sayfalarında bunlar sabit filtre olacak
|
|
14126
14125
|
this.category = null;
|
|
14127
14126
|
this.brand = null;
|
|
14127
|
+
this.category = data.category || null;
|
|
14128
|
+
this.brand = data.brand || null;
|
|
14128
14129
|
this.categories = data.categories || [];
|
|
14129
14130
|
this.brands = data.brands || [];
|
|
14130
14131
|
this.variantValues = data.variantValues || [];
|
|
@@ -14147,16 +14148,16 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14147
14148
|
this.getInitial = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
14148
14149
|
var page, limit, response_1, data_1, err_1;
|
|
14149
14150
|
var _this = this;
|
|
14150
|
-
var _a;
|
|
14151
|
-
return __generator(this, function (
|
|
14152
|
-
switch (
|
|
14151
|
+
var _a, _b, _c;
|
|
14152
|
+
return __generator(this, function (_d) {
|
|
14153
|
+
switch (_d.label) {
|
|
14153
14154
|
case 0:
|
|
14154
14155
|
if (this._isLoading)
|
|
14155
14156
|
return [2 /*return*/];
|
|
14156
14157
|
this._isLoading = true;
|
|
14157
|
-
|
|
14158
|
+
_d.label = 1;
|
|
14158
14159
|
case 1:
|
|
14159
|
-
|
|
14160
|
+
_d.trys.push([1, 3, 4, 5]);
|
|
14160
14161
|
page = this._page;
|
|
14161
14162
|
limit = this._limit;
|
|
14162
14163
|
if (this.isStatic) {
|
|
@@ -14178,9 +14179,12 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14178
14179
|
? (_a = this._productListPropValue.productIds) === null || _a === void 0 ? void 0 : _a.map(function (p) { return p.productId; }) : undefined,
|
|
14179
14180
|
page: page,
|
|
14180
14181
|
limit: limit,
|
|
14182
|
+
brandId: ((_b = this._filters) === null || _b === void 0 ? void 0 : _b.brand) ? this._filters.brand : undefined,
|
|
14183
|
+
categoryIds: ((_c = this._filters) === null || _c === void 0 ? void 0 : _c.category) ? [this._filters.category]
|
|
14184
|
+
: undefined,
|
|
14181
14185
|
})];
|
|
14182
14186
|
case 2:
|
|
14183
|
-
response_1 =
|
|
14187
|
+
response_1 = _d.sent();
|
|
14184
14188
|
data_1 = [];
|
|
14185
14189
|
if (this.isStatic) {
|
|
14186
14190
|
data_1 = this._productListPropValue.productIds.map(function (pID) {
|
|
@@ -14202,7 +14206,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14202
14206
|
});
|
|
14203
14207
|
return [3 /*break*/, 5];
|
|
14204
14208
|
case 3:
|
|
14205
|
-
err_1 =
|
|
14209
|
+
err_1 = _d.sent();
|
|
14206
14210
|
console.log(err_1);
|
|
14207
14211
|
return [3 /*break*/, 5];
|
|
14208
14212
|
case 4:
|
|
@@ -14217,9 +14221,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14217
14221
|
this.getPrev = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
14218
14222
|
var minPage_1, response_2, data_2, err_2;
|
|
14219
14223
|
var _this = this;
|
|
14220
|
-
var _a;
|
|
14221
|
-
return __generator(this, function (
|
|
14222
|
-
switch (
|
|
14224
|
+
var _a, _b, _c;
|
|
14225
|
+
return __generator(this, function (_d) {
|
|
14226
|
+
switch (_d.label) {
|
|
14223
14227
|
case 0:
|
|
14224
14228
|
if (this.isStatic ||
|
|
14225
14229
|
this.isDiscounted ||
|
|
@@ -14228,18 +14232,21 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14228
14232
|
!this.hasPrev)
|
|
14229
14233
|
return [2 /*return*/];
|
|
14230
14234
|
this._isLoading = true;
|
|
14231
|
-
|
|
14235
|
+
_d.label = 1;
|
|
14232
14236
|
case 1:
|
|
14233
|
-
|
|
14237
|
+
_d.trys.push([1, 3, 4, 5]);
|
|
14234
14238
|
minPage_1 = this._minPage - 1;
|
|
14235
14239
|
return [4 /*yield*/, IkasProductAPI.listProducts({
|
|
14236
14240
|
idList: this.isStatic
|
|
14237
14241
|
? (_a = this._productListPropValue.productIds) === null || _a === void 0 ? void 0 : _a.map(function (p) { return p.productId; }) : undefined,
|
|
14238
14242
|
page: minPage_1,
|
|
14239
14243
|
limit: this._limit,
|
|
14244
|
+
brandId: ((_b = this._filters) === null || _b === void 0 ? void 0 : _b.brand) ? this._filters.brand : undefined,
|
|
14245
|
+
categoryIds: ((_c = this._filters) === null || _c === void 0 ? void 0 : _c.category) ? [this._filters.category]
|
|
14246
|
+
: undefined,
|
|
14240
14247
|
})];
|
|
14241
14248
|
case 2:
|
|
14242
|
-
response_2 =
|
|
14249
|
+
response_2 = _d.sent();
|
|
14243
14250
|
data_2 = response_2.products.map(function (product) {
|
|
14244
14251
|
return new IkasProductDetail(product, product.variants[0].variantValues);
|
|
14245
14252
|
});
|
|
@@ -14250,7 +14257,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14250
14257
|
});
|
|
14251
14258
|
return [3 /*break*/, 5];
|
|
14252
14259
|
case 3:
|
|
14253
|
-
err_2 =
|
|
14260
|
+
err_2 = _d.sent();
|
|
14254
14261
|
console.log(err_2);
|
|
14255
14262
|
return [3 /*break*/, 5];
|
|
14256
14263
|
case 4:
|
|
@@ -14265,8 +14272,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14265
14272
|
this.getNext = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
14266
14273
|
var response_3, data_3, err_3;
|
|
14267
14274
|
var _this = this;
|
|
14268
|
-
|
|
14269
|
-
|
|
14275
|
+
var _a, _b;
|
|
14276
|
+
return __generator(this, function (_c) {
|
|
14277
|
+
switch (_c.label) {
|
|
14270
14278
|
case 0:
|
|
14271
14279
|
if (this.isStatic ||
|
|
14272
14280
|
this.isDiscounted ||
|
|
@@ -14275,15 +14283,18 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14275
14283
|
!this.hasNext)
|
|
14276
14284
|
return [2 /*return*/];
|
|
14277
14285
|
this._isLoading = true;
|
|
14278
|
-
|
|
14286
|
+
_c.label = 1;
|
|
14279
14287
|
case 1:
|
|
14280
|
-
|
|
14288
|
+
_c.trys.push([1, 3, 4, 5]);
|
|
14281
14289
|
return [4 /*yield*/, IkasProductAPI.listProducts({
|
|
14282
14290
|
page: this.page + 1,
|
|
14283
14291
|
limit: this.limit,
|
|
14292
|
+
brandId: ((_a = this._filters) === null || _a === void 0 ? void 0 : _a.brand) ? this._filters.brand : undefined,
|
|
14293
|
+
categoryIds: ((_b = this._filters) === null || _b === void 0 ? void 0 : _b.category) ? [this._filters.category]
|
|
14294
|
+
: undefined,
|
|
14284
14295
|
})];
|
|
14285
14296
|
case 2:
|
|
14286
|
-
response_3 =
|
|
14297
|
+
response_3 = _c.sent();
|
|
14287
14298
|
data_3 = response_3.products.map(function (product) {
|
|
14288
14299
|
return new IkasProductDetail(product, product.variants[0].variantValues);
|
|
14289
14300
|
});
|
|
@@ -14294,7 +14305,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14294
14305
|
});
|
|
14295
14306
|
return [3 /*break*/, 5];
|
|
14296
14307
|
case 3:
|
|
14297
|
-
err_3 =
|
|
14308
|
+
err_3 = _c.sent();
|
|
14298
14309
|
console.log(err_3);
|
|
14299
14310
|
return [3 /*break*/, 5];
|
|
14300
14311
|
case 4:
|
|
@@ -14309,8 +14320,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14309
14320
|
this.getPage = function (page) { return __awaiter(_this, void 0, void 0, function () {
|
|
14310
14321
|
var response_4, data_4, err_4;
|
|
14311
14322
|
var _this = this;
|
|
14312
|
-
|
|
14313
|
-
|
|
14323
|
+
var _a, _b;
|
|
14324
|
+
return __generator(this, function (_c) {
|
|
14325
|
+
switch (_c.label) {
|
|
14314
14326
|
case 0:
|
|
14315
14327
|
if (this._isLoading ||
|
|
14316
14328
|
this.isStatic ||
|
|
@@ -14318,15 +14330,18 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14318
14330
|
this.isRecommended)
|
|
14319
14331
|
return [2 /*return*/];
|
|
14320
14332
|
this._isLoading = true;
|
|
14321
|
-
|
|
14333
|
+
_c.label = 1;
|
|
14322
14334
|
case 1:
|
|
14323
|
-
|
|
14335
|
+
_c.trys.push([1, 3, 4, 5]);
|
|
14324
14336
|
return [4 /*yield*/, IkasProductAPI.listProducts({
|
|
14325
14337
|
page: this.page + 1,
|
|
14326
14338
|
limit: this.limit,
|
|
14339
|
+
brandId: ((_a = this._filters) === null || _a === void 0 ? void 0 : _a.brand) ? this._filters.brand : undefined,
|
|
14340
|
+
categoryIds: ((_b = this._filters) === null || _b === void 0 ? void 0 : _b.category) ? [this._filters.category]
|
|
14341
|
+
: undefined,
|
|
14327
14342
|
})];
|
|
14328
14343
|
case 2:
|
|
14329
|
-
response_4 =
|
|
14344
|
+
response_4 = _c.sent();
|
|
14330
14345
|
data_4 = response_4.products.map(function (product) {
|
|
14331
14346
|
return new IkasProductDetail(product, product.variants[0].variantValues);
|
|
14332
14347
|
});
|
|
@@ -14338,7 +14353,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
14338
14353
|
});
|
|
14339
14354
|
return [3 /*break*/, 5];
|
|
14340
14355
|
case 3:
|
|
14341
|
-
err_4 =
|
|
14356
|
+
err_4 = _c.sent();
|
|
14342
14357
|
console.log(err_4);
|
|
14343
14358
|
return [3 /*break*/, 5];
|
|
14344
14359
|
case 4:
|
|
@@ -19309,7 +19324,7 @@ var IkasProductAPI = /** @class */ (function () {
|
|
|
19309
19324
|
return __generator(this, function (_b) {
|
|
19310
19325
|
switch (_b.label) {
|
|
19311
19326
|
case 0:
|
|
19312
|
-
LIST_PRODUCTS = src(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n brandId\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "], ["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n brandId\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "])));
|
|
19327
|
+
LIST_PRODUCTS = src(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n $brandId: StringFilterInput\n $categoryIds: StringFilterInput\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n brandId: $brandId\n categoryIds: $categoryIds\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n brandId\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "], ["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n $brandId: StringFilterInput\n $categoryIds: StringFilterInput\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n brandId: $brandId\n categoryIds: $categoryIds\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n brandId\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "])));
|
|
19313
19328
|
_b.label = 1;
|
|
19314
19329
|
case 1:
|
|
19315
19330
|
_b.trys.push([1, 9, , 10]);
|
|
@@ -19327,6 +19342,16 @@ var IkasProductAPI = /** @class */ (function () {
|
|
|
19327
19342
|
limit: params.limit || 10,
|
|
19328
19343
|
};
|
|
19329
19344
|
}
|
|
19345
|
+
if (params === null || params === void 0 ? void 0 : params.brandId) {
|
|
19346
|
+
variables.brandId = {
|
|
19347
|
+
eq: params.brandId,
|
|
19348
|
+
};
|
|
19349
|
+
}
|
|
19350
|
+
if ((params === null || params === void 0 ? void 0 : params.categoryIds) && params.categoryIds.length) {
|
|
19351
|
+
variables.categoryIds = {
|
|
19352
|
+
in: params.categoryIds,
|
|
19353
|
+
};
|
|
19354
|
+
}
|
|
19330
19355
|
return [4 /*yield*/, apollo
|
|
19331
19356
|
.getClient()
|
|
19332
19357
|
.query({
|