druxt-router 0.24.2 → 0.25.0
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/CHANGELOG.md +11 -0
- package/dist/druxt-router.esm.js +11 -4
- package/dist/druxt-router.ssr.js +11 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/druxt-router.esm.js
CHANGED
|
@@ -104,7 +104,7 @@ class DruxtRouter {
|
|
|
104
104
|
}
|
|
105
105
|
async getRoute(path) {
|
|
106
106
|
const url = `/router/translate-path?path=${path}`;
|
|
107
|
-
const response = await this.druxt.
|
|
107
|
+
const response = await this.druxt.get(url, {
|
|
108
108
|
validateStatus: (status) => status < 500
|
|
109
109
|
});
|
|
110
110
|
const data = {
|
|
@@ -147,9 +147,16 @@ class DruxtRouter {
|
|
|
147
147
|
break;
|
|
148
148
|
}
|
|
149
149
|
if (!(response.status >= 200 && response.status < 300)) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
if (response.status === 404) {
|
|
151
|
+
if (typeof response.data !== "object") {
|
|
152
|
+
response.data = { errors: [{
|
|
153
|
+
detail: "Please ensure the Decoupled Router module is installed and configured correctly."
|
|
154
|
+
}] };
|
|
155
|
+
} else if (response.data.message || response.data.details) {
|
|
156
|
+
response.data.errors = [{ detail: [response.data.message, response.data.details].filter((s) => s).join("\n") }];
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
this.druxt.error({ response }, { url });
|
|
153
160
|
}
|
|
154
161
|
return route;
|
|
155
162
|
}
|
package/dist/druxt-router.ssr.js
CHANGED
|
@@ -112,7 +112,7 @@ class DruxtRouter {
|
|
|
112
112
|
}
|
|
113
113
|
async getRoute(path) {
|
|
114
114
|
const url = `/router/translate-path?path=${path}`;
|
|
115
|
-
const response = await this.druxt.
|
|
115
|
+
const response = await this.druxt.get(url, {
|
|
116
116
|
validateStatus: (status) => status < 500
|
|
117
117
|
});
|
|
118
118
|
const data = {
|
|
@@ -155,9 +155,16 @@ class DruxtRouter {
|
|
|
155
155
|
break;
|
|
156
156
|
}
|
|
157
157
|
if (!(response.status >= 200 && response.status < 300)) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
if (response.status === 404) {
|
|
159
|
+
if (typeof response.data !== "object") {
|
|
160
|
+
response.data = { errors: [{
|
|
161
|
+
detail: "Please ensure the Decoupled Router module is installed and configured correctly."
|
|
162
|
+
}] };
|
|
163
|
+
} else if (response.data.message || response.data.details) {
|
|
164
|
+
response.data.errors = [{ detail: [response.data.message, response.data.details].filter((s) => s).join("\n") }];
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
this.druxt.error({ response }, { url });
|
|
161
168
|
}
|
|
162
169
|
return route;
|
|
163
170
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "druxt-router",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "Drupal router for Nuxt, powered by the Drupal Decoupled Router module.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"templates"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"druxt": "^0.
|
|
45
|
+
"druxt": "^0.16.0",
|
|
46
46
|
"url-parse": "^1.4.7"
|
|
47
47
|
},
|
|
48
48
|
"optionalDependencies": {
|