43bbcece7a
Backend: adds JDBC session support, login/status/logout endpoints, and new DTOs (AuthResponse, ConnectionStatusResponse, LoginResult). Frontend replaces the Vite boilerplate with a Dashboard, ServiceCard, and ConnectModal backed by a typed API client. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 lines
457 B
TypeScript
12 lines
457 B
TypeScript
import { apiFetch } from './client'
|
|
import type { AuthResponse, ConnectionStatus, LoginRequest } from '../types/connection'
|
|
|
|
export const login = (req: LoginRequest) =>
|
|
apiFetch<AuthResponse>('/login', { method: 'POST', body: JSON.stringify(req) })
|
|
|
|
export const getStatuses = () =>
|
|
apiFetch<ConnectionStatus[]>('/connections/status')
|
|
|
|
export const logout = (serviceType: string) =>
|
|
apiFetch<void>(`/connections/${serviceType}`, { method: 'DELETE' })
|