getpathtranslation invalid path temporary workarround

This commit is contained in:
2021-03-08 14:41:22 +01:00
parent 30b2c9267b
commit 7e460b9764
3 changed files with 19 additions and 63 deletions

View File

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