fix: remove /api/ double-prefix from all frontend API calls
Frontend api.ts baseUrl is already "/api", so paths like "/api/cases" produced "/api/api/cases". Stripped the redundant prefix from all component calls. Rewrite destination correctly adds /api/ back for the Go backend.
This commit is contained in:
@@ -57,7 +57,7 @@ export function CalDAVSettings({ tenant }: { tenant: Tenant }) {
|
||||
// Fetch sync status
|
||||
const { data: syncStatus } = useQuery({
|
||||
queryKey: ["caldav-status"],
|
||||
queryFn: () => api.get<CalDAVSyncResponse>("/api/caldav/status"),
|
||||
queryFn: () => api.get<CalDAVSyncResponse>("/caldav/status"),
|
||||
refetchInterval: 30_000,
|
||||
});
|
||||
|
||||
@@ -83,7 +83,7 @@ export function CalDAVSettings({ tenant }: { tenant: Tenant }) {
|
||||
|
||||
// Trigger sync
|
||||
const syncMutation = useMutation({
|
||||
mutationFn: () => api.post<CalDAVSyncResponse>("/api/caldav/sync"),
|
||||
mutationFn: () => api.post<CalDAVSyncResponse>("/caldav/sync"),
|
||||
onSuccess: (result) => {
|
||||
queryClient.invalidateQueries({ queryKey: ["caldav-status"] });
|
||||
if (result.status === "ok") {
|
||||
|
||||
Reference in New Issue
Block a user