|
@@ -184,13 +184,17 @@ import { MA } from 'vuejs/api/ma-axios'
|
|
MA.post(`materio_decoupled/path_translation_links?`, params)
|
|
MA.post(`materio_decoupled/path_translation_links?`, params)
|
|
.then(({ data }) => {
|
|
.then(({ data }) => {
|
|
console.log('Path translations links', data)
|
|
console.log('Path translations links', data)
|
|
- links.forEach((link, i) => {
|
|
|
|
- console.log("language link",path , link)
|
|
|
|
- let hreflang = link.getAttribute('hreflang')
|
|
|
|
-
|
|
|
|
- link.setAttribute('href', data.links[hreflang].url)
|
|
|
|
- link.innerHTML = data.links[hreflang].title
|
|
|
|
- });
|
|
|
|
|
|
+ if (data.error) {
|
|
|
|
+ console.warn("error get translation paths", data.error);
|
|
|
|
+ } else {
|
|
|
|
+ links.forEach((link, i) => {
|
|
|
|
+ console.log("language link",path , link)
|
|
|
|
+ let hreflang = link.getAttribute('hreflang')
|
|
|
|
+
|
|
|
|
+ link.setAttribute('href', data.links[hreflang].url)
|
|
|
|
+ link.innerHTML = data.links[hreflang].title
|
|
|
|
+ });
|
|
|
|
+ }
|
|
})
|
|
})
|
|
.catch(error => {
|
|
.catch(error => {
|
|
console.warn('Path translations links', error)
|
|
console.warn('Path translations links', error)
|