@q2devel/q2-core 1.0.17 → 1.0.19
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProducts.d.ts","sourceRoot":"","sources":["../../../api/products/getProducts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAKtD,KAAK,iBAAiB,GAAG;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;QAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;KACpB,CAAC,CAAA;IACF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC5E,CAAA;AAED,eAAO,MAAM,WAAW,GACpB,KAAK,WAAW,EAChB,oHAmBG,iBAAiB,KACrB,OAAO,CAAC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"getProducts.d.ts","sourceRoot":"","sources":["../../../api/products/getProducts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE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}` : '',
|
|
21
21
|
filters.length ? `filters:${JSON.stringify(filters)}` : '',
|
|
22
22
|
sort ? `sort:${sort}` : '',
|
|
23
|
-
|
|
23
|
+
tag ? `tag:${tag}` : '',
|
|
24
24
|
]
|
|
25
25
|
.filter(Boolean)
|
|
26
26
|
.join(':');
|
|
@@ -50,10 +50,11 @@ export const getProducts = async (ctx, { locale, categoryId, productId, searchTe
|
|
|
50
50
|
params.addSort(sortData.title, sortData.direction);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
+
const queryString = params.getQueryString();
|
|
53
54
|
const url = currentLocale === ctx.defaultLocale
|
|
54
55
|
? `/jsonapi/index/variation`
|
|
55
56
|
: `/${currentLocale}/jsonapi/index/variation`;
|
|
56
|
-
const { data } = await ctx.axios.get(`${url}?${
|
|
57
|
+
const { data } = await ctx.axios.get(queryString ? `${url}?${queryString}` : url);
|
|
57
58
|
const resolvedProducts = mapIncludedResources(data, 5);
|
|
58
59
|
const mappedProducts = await Promise.all(resolvedProducts.map(async (item) => {
|
|
59
60
|
const base = mapProduct(item.product_id, item, ctx);
|
|
@@ -88,10 +89,11 @@ export const getProductCount = async (ctx, { categoryId = [], tag = '', cache =
|
|
|
88
89
|
params.addFilter(`product_id.${tag}`, '1');
|
|
89
90
|
}
|
|
90
91
|
params.addFilter('langcode', ctx.locale).addPageLimit(1);
|
|
92
|
+
const queryString = params.getQueryString();
|
|
91
93
|
const url = ctx.locale === ctx.defaultLocale
|
|
92
94
|
? `/jsonapi/index/variation`
|
|
93
95
|
: `/${ctx.locale}/jsonapi/index/variation`;
|
|
94
|
-
const { data } = await ctx.axios.get(`${url}?${
|
|
96
|
+
const { data } = await ctx.axios.get(queryString ? `${url}?${queryString}` : url);
|
|
95
97
|
if (cache && ctx.setCache) {
|
|
96
98
|
await ctx.setCache(cacheKey, data.meta?.count ?? 0);
|
|
97
99
|
}
|