Files
Charon/frontend/src/api/domains.ts
2025-11-24 18:22:01 +00:00

23 lines
526 B
TypeScript

import client from './client'
export interface Domain {
id: number
uuid: string
name: string
created_at: string
}
export const getDomains = async (): Promise<Domain[]> => {
const { data } = await client.get<Domain[]>('/domains')
return data
}
export const createDomain = async (name: string): Promise<Domain> => {
const { data } = await client.post<Domain>('/domains', { name })
return data
}
export const deleteDomain = async (uuid: string): Promise<void> => {
await client.delete(`/domains/${uuid}`)
}