@lancom/shared 0.0.471 → 0.0.473

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.
@@ -8,36 +8,15 @@ import { getProductLargeCover, getProductMediumCover } from '@lancom/shared/asse
8
8
  export default {
9
9
  mixins: [metaInfo],
10
10
  middleware: ['page-info'],
11
- async asyncData({ store, route, res }) {
12
- const shop = store.getters.shop;
13
- const country = store.getters.country;
14
- const currency = store.getters.currency;
11
+ async fetch() {
12
+ await this.loadProducts();
15
13
 
16
- const params = {
17
- ...route.params,
18
- ...route.query,
19
- country: country?._id,
20
- currency: currency?._id,
21
- limit: 80
22
- };
23
-
24
- try {
25
- await store.dispatch('products/fetchProducts', { params, shop: shop._id });
26
- } catch {
27
- if (process.server && res) {
28
- const loadError = store.getters['products/loadError'];
29
- res.statusCode = loadError?.statusCode || 500;
30
- }
31
- }
32
-
33
- const page = store.getters['products/page'];
34
- if (page === 1) {
35
- const category = store.getters['products/category'];
36
- await store.dispatch('products/fetchChildrenCategories', { category, shop });
14
+ if (this.page === 1) {
15
+ await this.fetchChildrenCategories(this.currentCategory);
37
16
  }
38
17
 
39
- if (process.server && res) {
40
- res.setHeader('Cache-Control', `max-age=${86400}`);
18
+ if (process.server) {
19
+ this.$root.context?.res?.setHeader('Cache-Control', `max-age=${86400}`);;
41
20
  }
42
21
  },
43
22
  computed: {
package/nuxt.config.js CHANGED
@@ -53,7 +53,6 @@ module.exports = (config, axios, { raygunClient, publicPath, productUrlToEditor,
53
53
  lastmod: formatSitemapDate(getCurrentMonthFirstDay())
54
54
  },
55
55
  exclude: [
56
- // '/',
57
56
  '/faq',
58
57
  '/quotes/request',
59
58
  sitemapWithoutProductTypes ? '/products' : null,
@@ -69,10 +68,10 @@ module.exports = (config, axios, { raygunClient, publicPath, productUrlToEditor,
69
68
  return [
70
69
  { url: '/', lastmod: defaultLastmod },
71
70
  ...data.map(item => {
72
- const url = item.url || item.link || item;
71
+ const url = item.url || item.link;
73
72
  const updatedAt = item.updatedAt;
74
73
  return {
75
- url,
74
+ url: typeof url === 'string' ? url : item,
76
75
  lastmod: updatedAt ? formatSitemapDate(new Date(updatedAt)) : defaultLastmod
77
76
  };
78
77
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.471",
3
+ "version": "0.0.473",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {