mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 12:50:05 +01:00
chore: cleanup and route refactoring
Signed-off-by: allanice001 <allanice001@gmail.com>
This commit is contained in:
49
ui/src/api/dns.ts
Normal file
49
ui/src/api/dns.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { withRefresh } from "@/api/with-refresh.ts"
|
||||
import type {
|
||||
DtoCreateDomainRequest,
|
||||
DtoCreateRecordSetRequest,
|
||||
DtoUpdateDomainRequest,
|
||||
DtoUpdateRecordSetRequest,
|
||||
} from "@/sdk"
|
||||
import { makeDnsApi } from "@/sdkClient.ts"
|
||||
|
||||
const dns = makeDnsApi()
|
||||
|
||||
export const dnsApi = {
|
||||
listDomains: () =>
|
||||
withRefresh(async () => {
|
||||
return await dns.listDomains()
|
||||
}),
|
||||
getDomain: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
return await dns.getDomain({ id })
|
||||
}),
|
||||
createDomain: async (body: DtoCreateDomainRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await dns.createDomain({ body })
|
||||
}),
|
||||
updateDomain: async (id: string, body: DtoUpdateDomainRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await dns.updateDomain({ id, body })
|
||||
}),
|
||||
deleteDomain: async (id: string) =>
|
||||
withRefresh(async () => {
|
||||
return await dns.deleteDomain({ id })
|
||||
}),
|
||||
listRecordSetsByDomain: async (domainId: string) =>
|
||||
withRefresh(async () => {
|
||||
return await dns.listRecordSets({ domainId })
|
||||
}),
|
||||
createRecordSetsByDomain: async (domainId: string, body: DtoCreateRecordSetRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await dns.createRecordSet({ domainId, body })
|
||||
}),
|
||||
updateRecordSetsByDomain: async (id: string, body: DtoUpdateRecordSetRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await dns.updateRecordSet({ id, body })
|
||||
}),
|
||||
deleteRecordSetsByDomain: async (id: string) =>
|
||||
withRefresh(async () => {
|
||||
return await dns.deleteRecordSet({ id })
|
||||
}),
|
||||
}
|
||||
Reference in New Issue
Block a user