From 467694bd9b242c37e07181a9530e4c18dd6a97f2 Mon Sep 17 00:00:00 2001 From: Sebastien DUMETZ Date: Mon, 8 Jul 2024 10:40:06 +0200 Subject: [PATCH] remove /api/v1 prefix in ui routes --- source/ui/MainView.ts | 1 - source/ui/composants/UserLogin.ts | 2 +- source/ui/screens/Admin/AdminArchives.ts | 4 +- source/ui/screens/Admin/AdminHome.ts | 4 +- source/ui/screens/Admin/AdminStats.ts | 4 +- source/ui/screens/Admin/UsersList.ts | 8 +- source/ui/screens/FileHistory.ts | 138 ----------------------- source/ui/screens/Home.ts | 2 +- source/ui/screens/List.ts | 4 +- source/ui/screens/SceneHistory.ts | 14 +-- source/ui/screens/UserSettings.ts | 2 +- source/ui/state/auth.ts | 6 +- source/ui/state/withScenes.ts | 2 +- 13 files changed, 26 insertions(+), 165 deletions(-) delete mode 100644 source/ui/screens/FileHistory.ts diff --git a/source/ui/MainView.ts b/source/ui/MainView.ts index faf99c08..08b9f789 100644 --- a/source/ui/MainView.ts +++ b/source/ui/MainView.ts @@ -14,7 +14,6 @@ import "./composants/navbar/ChangeLocale"; import "./screens/List"; import "./screens/Admin"; import "./screens/SceneHistory"; -import "./screens/FileHistory"; import "./screens/UserSettings"; import "./screens/Home" import "./composants/Modal"; diff --git a/source/ui/composants/UserLogin.ts b/source/ui/composants/UserLogin.ts index 49120f37..3e76e59b 100644 --- a/source/ui/composants/UserLogin.ts +++ b/source/ui/composants/UserLogin.ts @@ -51,7 +51,7 @@ import Notification from "./Notification"; ev.preventDefault(); const username = ev.target["username"].value; this.active = true; - fetch(`/api/v1/login/${username}/link`, { + fetch(`/auth/login/${username}/link`, { method: "POST", }).then(async (r)=>{ if(!r.ok){ diff --git a/source/ui/screens/Admin/AdminArchives.ts b/source/ui/screens/Admin/AdminArchives.ts index 17c70c20..fab900b7 100644 --- a/source/ui/screens/Admin/AdminArchives.ts +++ b/source/ui/screens/Admin/AdminArchives.ts @@ -47,7 +47,7 @@ interface User { fetchScenes() : void{ this.loading = true; - fetch("/api/v1/scenes?access=none") + fetch("/scenes?access=none") .then(HttpError.okOrThrow) .then(async (r)=>{ this.list = (await r.json()).scenes; @@ -61,7 +61,7 @@ interface User { onDeleteScene = (ev :MouseEvent, s :Scene)=>{ ev.preventDefault(); - fetch(`/api/v1/scenes/${s.name}?archive=false`, { + fetch(`/scenes/${s.name}?archive=false`, { headers: {"Content-Type": "application/json"}, method: "DELETE" }).then(HttpError.okOrThrow) diff --git a/source/ui/screens/Admin/AdminHome.ts b/source/ui/screens/Admin/AdminHome.ts index 3c35f5ba..50bc01b2 100644 --- a/source/ui/screens/Admin/AdminHome.ts +++ b/source/ui/screens/Admin/AdminHome.ts @@ -18,7 +18,7 @@ export class TestmailModalBody extends i18n(LitElement){ protected render(): unknown { let onsend = ()=>{ this.state = "sending"; - fetch("/api/v1/admin/mailtest", {method: "POST"}).then(async (r)=>{ + fetch("/admin/mailtest", {method: "POST"}).then(async (r)=>{ let msg = await r.text(); if(r.ok){ this.state = "OK: "+msg; @@ -73,7 +73,7 @@ export default class AdminHomeScreen extends i18n(LitElement) {

${this.t("ui.tools")}