Skip to content

Commit 258f60c

Browse files
ciro-macielclaude
andcommitted
fix: Atualiza rotas do frontend para usar prefixo /sqlite
Corrige todas as referências de /admin para /sqlite no frontend, alinhando com o novo prefixo padrão definido no backend. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 28559f1 commit 258f60c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/ui/src/App.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ import { TableSelector } from "./components/TableSelector";
8282
import { DataGrid } from "./components/DataGrid";
8383
import { Pagination } from "./components/Pagination";
8484

85-
const API = "/admin/api";
85+
const API = "/sqlite/api";
8686

8787
// Column type icon mapping
8888
const getColumnIcon = (type, name) => {
@@ -281,7 +281,7 @@ export default function App() {
281281
// ... (rest of checkAuth and useEffect)
282282
const checkAuth = async () => {
283283
try {
284-
const res = await fetch("/admin/auth/status");
284+
const res = await fetch("/sqlite/auth/status");
285285
const data = await res.json();
286286
setAuth(data);
287287
} catch (e) {
@@ -295,7 +295,7 @@ export default function App() {
295295

296296
const handleLogout = async () => {
297297
try {
298-
await fetch("/admin/auth/logout", { method: "POST" });
298+
await fetch("/sqlite/auth/logout", { method: "POST" });
299299
setAuth({ ...auth, authenticated: false, user: null });
300300
notifications.show({
301301
title: "Logged out",

src/ui/src/components/Login.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function Login({ onLogin }) {
2727
e.preventDefault();
2828
setLoading(true);
2929
try {
30-
const response = await fetch("/admin/auth/login", {
30+
const response = await fetch("/sqlite/auth/login", {
3131
method: "POST",
3232
headers: { "Content-Type": "application/json" },
3333
body: JSON.stringify({ username, password, totpCode }),

src/ui/src/components/Onboarding.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function Onboarding({ onConfigured }) {
3333

3434
setLoading(true);
3535
try {
36-
const response = await fetch("/admin/api/setup", {
36+
const response = await fetch("/sqlite/api/setup", {
3737
method: "POST",
3838
headers: { "Content-Type": "application/json" },
3939
body: JSON.stringify({ username, password }),

src/ui/src/components/SecuritySettings.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function SecuritySettings({ opened, onClose }) {
4242
const loadStatus = async () => {
4343
setLoading(true);
4444
try {
45-
const res = await fetch("/admin/auth/status");
45+
const res = await fetch("/sqlite/auth/status");
4646
const data = await res.json();
4747
setStatus(data);
4848
} catch (e) {
@@ -58,7 +58,7 @@ export function SecuritySettings({ opened, onClose }) {
5858
const startSetup = async () => {
5959
setSetupStep(1); // generating
6060
try {
61-
const res = await fetch("/admin/api/totp/generate", { method: "POST" });
61+
const res = await fetch("/sqlite/api/totp/generate", { method: "POST" });
6262
const data = await res.json();
6363
if (data.success) {
6464
setQrData(data);
@@ -80,7 +80,7 @@ export function SecuritySettings({ opened, onClose }) {
8080
if (!verifyCode) return;
8181
setVerifying(true);
8282
try {
83-
const res = await fetch("/admin/api/totp/verify", {
83+
const res = await fetch("/sqlite/api/totp/verify", {
8484
method: "POST",
8585
headers: { "Content-Type": "application/json" },
8686
body: JSON.stringify({ secret: qrData.secret, code: verifyCode }),
@@ -119,7 +119,7 @@ export function SecuritySettings({ opened, onClose }) {
119119
if (!code) return;
120120

121121
try {
122-
const res = await fetch("/admin/api/totp/disable", {
122+
const res = await fetch("/sqlite/api/totp/disable", {
123123
method: "POST",
124124
headers: { "Content-Type": "application/json" },
125125
body: JSON.stringify({ code }),

0 commit comments

Comments
 (0)