summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade
diff options
context:
space:
mode:
authorDaniel Nilsson <daniel.nilsson94@outlook.com>2024-07-20 21:25:50 +0200
committerPaul Donald <newtwen+github@gmail.com>2024-07-23 12:32:00 +0200
commite55f9d967a158fffed70c05ec03694bc73559a05 (patch)
tree60c45c708b2e4447007f18eb9dfb1e0671a86ad1 /applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade
parent698ee7e944950ec14c385885e57994d00f0490b4 (diff)
luci-app-attendedsysupgrade: use versioned endpoints
The unversioned endpoint /api/overview has been removed from ASU which breaks the request when searching for an available sysupgrade if the device is on a stable release. In the case where the unversioned endpoint is added back to prevent this regression in 23.05.3 and earlier (so upgrade is once again possible) we should anyway rely on the versioned endpoints as those replace the unversioned ones. Signed-off-by: Daniel Nilsson <daniel.nilsson94@outlook.com>
Diffstat (limited to 'applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade')
-rw-r--r--applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js b/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js
index 0e6ae9d20c..011215ca3c 100644
--- a/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js
+++ b/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js
@@ -399,10 +399,9 @@ return view.extend({
let { url, revision, advanced_mode, branch } = data;
let { version, target, profile, packages } = firmware;
let candidates = [];
- let request_url = `${url}/api/overview`;
- if (version.endsWith('SNAPSHOT')) {
- request_url = `${url}/api/v1/revision/${version}/${target}`;
- }
+
+ const endpoint = version.endsWith('SNAPSHOT') ? `revision/${version}/${target}` : 'overview';
+ const request_url = `${url}/api/v1/${endpoint}`;
ui.showModal(_('Searching...'), [
E(