fix(api): align frontend with REST contracts

This commit is contained in:
2026-07-30 20:38:52 +08:00
parent b57e58ff87
commit 782363cfb6
65 changed files with 99362 additions and 318 deletions
+3 -3
View File
@@ -78,7 +78,7 @@ const App = (props: React.PropsWithChildren<AppProps>) => {
let cancelled = false;
setAccessLoading(true);
apiFetch(`${config.BACKEND_URL}/api/v1/access/context`, {
apiFetch(`${config.BACKEND_URL}/api/v1/access-context`, {
projectHeaderMode: currentProjectId ? "include" : "omit",
skipAuthRedirect: true,
})
@@ -110,7 +110,7 @@ const App = (props: React.PropsWithChildren<AppProps>) => {
const auditKey = `tjwater-login-audit:${data.user.id}`;
if (sessionStorage.getItem(auditKey)) return;
apiFetch(`${config.BACKEND_URL}/api/v1/audit/session-events`, {
apiFetch(`${config.BACKEND_URL}/api/v1/audit-events`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ event: "login" }),
@@ -137,7 +137,7 @@ const App = (props: React.PropsWithChildren<AppProps>) => {
},
logout: async () => {
try {
await apiFetch(`${config.BACKEND_URL}/api/v1/audit/session-events`, {
await apiFetch(`${config.BACKEND_URL}/api/v1/audit-events`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ event: "logout" }),