From 651f74e4e288889edda120583eaec9e8d2bd3704 Mon Sep 17 00:00:00 2001 From: Eike Broda Date: Mon, 13 Apr 2026 17:39:41 +0200 Subject: [PATCH 1/2] Make fetch calls relative (fixes #2292) --- dataedit/static/metaedit/metaedit.js | 6 ++---- oeo_ext/templates/oeo_ext/partials/unit_element.html | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dataedit/static/metaedit/metaedit.js b/dataedit/static/metaedit/metaedit.js index 910869b79..1b12f1ec5 100644 --- a/dataedit/static/metaedit/metaedit.js +++ b/dataedit/static/metaedit/metaedit.js @@ -426,8 +426,7 @@ window.MetaEdit = function (config) { window.JSONEditor.defaults.callbacks = { autocomplete: { search_name: function search(jseditor_editor, input) { - var url = - "https://openenergyplatform.org/api/oeo-search?query=" + input; + var url = "/api/oeo-search?query=" + input; return new Promise(function (resolve) { fetch(url, { @@ -549,8 +548,7 @@ window.MetaEdit = function (config) { window.JSONEditor.defaults.callbacks = { autocomplete: { search_name: function search(jseditor_editor, input) { - var url = - "https://openenergyplatform.org/api/oeo-search?query=" + input; + var url = "/api/oeo-search?query=" + input; return new Promise(function (resolve) { fetch(url, { diff --git a/oeo_ext/templates/oeo_ext/partials/unit_element.html b/oeo_ext/templates/oeo_ext/partials/unit_element.html index 2261f5f09..71f711463 100644 --- a/oeo_ext/templates/oeo_ext/partials/unit_element.html +++ b/oeo_ext/templates/oeo_ext/partials/unit_element.html @@ -48,7 +48,7 @@ if (query.length > 0) { // use static path here to always use the open (data seeded) endpoint for // all (local, deployed) client executions - fetch(`https://openenergyplatform.org/api/oeo-search?query=${query}`, { + fetch(`/api/oeo-search?query=${query}`, { mode: "cors", }) .then((response) => response.json()) From 415a1e57e878783c555dfd2e4ad59abffad20667 Mon Sep 17 00:00:00 2001 From: Eike Broda Date: Mon, 13 Apr 2026 17:47:52 +0200 Subject: [PATCH 2/2] Update changelog for #2293 --- versions/changelogs/current.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/versions/changelogs/current.md b/versions/changelogs/current.md index 40007699b..d0a3db233 100644 --- a/versions/changelogs/current.md +++ b/versions/changelogs/current.md @@ -13,6 +13,9 @@ SPDX-License-Identifier: CC0-1.0 - Create tables_sections.html, delete user_partial_tables [(#2248)](https://github.com/OpenEnergyPlatform/oeplatform/pull/2248) +- Update fetch call for oeo-search api to be relative + [(#2293)](https://github.com/OpenEnergyPlatform/oeplatform/pull/2293) + ### Features - Build search field to search in the user's tables