Rework initial commit

- moved frontend configuration api to new subrouter for compatibility
This commit is contained in:
Christoph Kluge
2024-07-03 17:24:26 +02:00
parent 552da005dc
commit 61eebc9fbd
17 changed files with 201 additions and 114 deletions

View File

@@ -48,7 +48,7 @@
<form
id="create-user-form"
method="post"
action="/api/users/"
action="/config/users/"
class="card-body"
on:submit|preventDefault={handleUserSubmit}
>

View File

@@ -22,7 +22,7 @@
formData.append("add-project", project);
try {
const res = await fetch(`/api/user/${username}`, {
const res = await fetch(`/config/user/${username}`, {
method: "POST",
body: formData,
});
@@ -54,7 +54,7 @@
formData.append("remove-project", project);
try {
const res = await fetch(`/api/user/${username}`, {
const res = await fetch(`/config/user/${username}`, {
method: "POST",
body: formData,
});

View File

@@ -24,7 +24,7 @@
formData.append("add-role", role);
try {
const res = await fetch(`/api/user/${username}`, {
const res = await fetch(`/config/user/${username}`, {
method: "POST",
body: formData,
});
@@ -56,7 +56,7 @@
formData.append("remove-role", role);
try {
const res = await fetch(`/api/user/${username}`, {
const res = await fetch(`/config/user/${username}`, {
method: "POST",
body: formData,
});

View File

@@ -20,7 +20,7 @@
if (confirm("Are you sure?")) {
let formData = new FormData();
formData.append("username", username);
fetch("/api/users/", { method: "DELETE", body: formData }).then((res) => {
fetch("/config/users/", { method: "DELETE", body: formData }).then((res) => {
if (res.status == 200) {
reloadUserList();
} else {

View File

@@ -5,7 +5,7 @@
let jwt = "";
function getUserJwt(username) {
fetch(`/api/jwt/?username=${username}`)
fetch(`/config/jwt/?username=${username}`)
.then((res) => res.text())
.then((text) => {
jwt = text;