refactored to make use of the ServiceType enum throughout backend and frontend for typesafety

This commit is contained in:
2026-06-24 23:25:18 +02:00
parent 38c72d1bb8
commit fb64a7787f
24 changed files with 278 additions and 263 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { apiFetch } from './client'
import type { AuthResponse, ConnectionStatus, LoginRequest } from '../types/connection'
import type { AuthResponse, ConnectionStatus, LoginRequest, ServiceType } from '../types/connection'
export const login = (req: LoginRequest) =>
apiFetch<AuthResponse>('/login', { method: 'POST', body: JSON.stringify(req) })
@@ -7,5 +7,5 @@ export const login = (req: LoginRequest) =>
export const getStatuses = () =>
apiFetch<ConnectionStatus[]>('/connections/status')
export const logout = (serviceType: string) =>
export const logout = (serviceType: ServiceType) =>
apiFetch<void>(`/connections/${serviceType}`, { method: 'DELETE' })