@griddo/cx 1.55.8 → 1.55.9
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/package.json +3 -3
- package/src/services/distributors.js +7 -13
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/cx",
|
|
3
3
|
"description": "Griddo SSG based on Gatsby",
|
|
4
|
-
"version": "1.55.
|
|
4
|
+
"version": "1.55.9",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"react-helmet": "^6.0.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@griddo/eslint-config-back": "^1.55.
|
|
64
|
+
"@griddo/eslint-config-back": "^1.55.9",
|
|
65
65
|
"eslint": "^7.5.0",
|
|
66
66
|
"eslint-plugin-node": "^11.1.0",
|
|
67
67
|
"eslint-plugin-react": "7.14.3",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "a0d2c7c6c8c1a7fa0121feed5425849d8c8caf91"
|
|
97
97
|
}
|
|
@@ -20,6 +20,10 @@ class DistributorService {
|
|
|
20
20
|
|
|
21
21
|
static async fetchData({ page, component }) {
|
|
22
22
|
const { data } = component;
|
|
23
|
+
if (!data) {
|
|
24
|
+
console.log(`======= ERROR: Página ${page.id} tiene un hasDistributorData pero no un elemento data con la configuración del distribuidor en el mismo nivel.`);
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
23
27
|
const body = this.getBody(data);
|
|
24
28
|
const response = await SitesService.getDistributorData(page, body);
|
|
25
29
|
return response;
|
|
@@ -46,20 +50,10 @@ class DistributorService {
|
|
|
46
50
|
};
|
|
47
51
|
|
|
48
52
|
const getDistributors = async (template) => {
|
|
49
|
-
await getDistributorsContent(template);
|
|
50
|
-
|
|
51
|
-
const mappedTemplate = template.hasDistributorData
|
|
52
|
-
? {
|
|
53
|
-
...template,
|
|
54
|
-
queriedItems: await this.fetchData({ page, component: template }),
|
|
55
|
-
}
|
|
56
|
-
: {
|
|
57
|
-
...template,
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return mappedTemplate;
|
|
53
|
+
await getDistributorsContent([template]); // ==> En array para que también revise la propia template como objeto.
|
|
54
|
+
return template;
|
|
61
55
|
};
|
|
62
|
-
|
|
56
|
+
|
|
63
57
|
const response = await getDistributors(template);
|
|
64
58
|
return response;
|
|
65
59
|
} catch (e) {
|