fix: remove /api prefix from conversation API calls in frontend
Deploy Dashboard (Dev) / deploy-dev (push) Failing after 3m37s
Run Tests / Backend Tests (push) Failing after 4m24s
Run Tests / Frontend Tests (push) Failing after 48s
Run Tests / Test Summary (push) Failing after 13s

This commit is contained in:
Gan, Jimmy
2026-04-19 20:40:08 +08:00
parent c18d677797
commit 9b8d7cfb00
@@ -18,7 +18,7 @@
onMount(async () => {
try {
dates = await get("/api/conversations/dates");
dates = await get("/conversations/dates");
if (dates.length) selectDate(dates[0]);
loadStats();
} catch (e) {
@@ -32,8 +32,8 @@
loading = true;
error = "";
try {
summary = await get(`/api/conversations/summary/${d}`);
conversations = await get(`/api/conversations/list?date=${d}`);
summary = await get(`/conversations/summary/${d}`);
conversations = await get(`/conversations/list?date=${d}`);
} catch (e) {
summary = null;
if (e.status !== 404) error = e.body?.detail || "Failed to load summary";
@@ -46,8 +46,8 @@
view = "detail";
loading = true;
try {
selectedConversation = await get(`/api/conversations/${sessionId}`);
messages = await get(`/api/conversations/${sessionId}/messages`);
selectedConversation = await get(`/conversations/${sessionId}`);
messages = await get(`/conversations/${sessionId}/messages`);
} catch (e) {
error = "Failed to load conversation";
} finally {
@@ -60,7 +60,7 @@
view = "search";
loading = true;
try {
searchResults = await get(`/api/conversations/search?q=${encodeURIComponent(searchQuery)}`);
searchResults = await get(`/conversations/search?q=${encodeURIComponent(searchQuery)}`);
} catch (e) {
error = "Search failed";
} finally {
@@ -70,7 +70,7 @@
async function loadStats() {
try {
stats = await get("/api/conversations/stats");
stats = await get("/conversations/stats");
} catch (e) {
console.error("Failed to load stats", e);
}
@@ -79,7 +79,7 @@
async function trigger() {
triggering = true;
try {
await post("/api/conversations/trigger");
await post("/conversations/trigger");
setTimeout(() => selectDate(selectedDate), 5000);
} catch (e) {
error = "Trigger failed";