Ver Fonte

fix undefined uri in prod

Olivier Massot há 4 anos atrás
pai
commit
b3af08194d

+ 2 - 1
ot_templating/Resources/Public/assets/Classic/script/structures.js

@@ -1,12 +1,13 @@
 // Specific code for the 'federation-structures' page
 
+const default_uri = "https://api.opentalent.fr";
 const variants_uris = {
     "preprod.opentalent.fr": "https://api.preprod.opentalent.fr",
     "local.sub.opentalent.fr": "https://local.api.opentalent.fr",
     "typo3": "http://docker.nginx.opentalent.fr"
 };
 
-const base_uri = variants_uris[$(location).attr('hostname')];
+const base_uri = variants_uris[$(location).attr('hostname')] ?? default_uri;
 let apiGetUrl = base_uri + '/api/public/federation_structures?_format=json&page=1&itemsPerPage=99999';