refactored to make use of the ServiceType enum throughout backend and frontend for typesafety
This commit is contained in:
@@ -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' })
|
||||
|
||||
Reference in New Issue
Block a user