mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 21:00:06 +01:00
feat: sdk migration in progress
This commit is contained in:
28
ui/src/api/servers.ts
Normal file
28
ui/src/api/servers.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { withRefresh } from "@/api/with-refresh.ts"
|
||||
import type { DtoCreateServerRequest, DtoUpdateServerRequest } from "@/sdk"
|
||||
import { makeServersApi } from "@/sdkClient.ts"
|
||||
|
||||
const servers = makeServersApi()
|
||||
|
||||
export const serversApi = {
|
||||
listServers: () =>
|
||||
withRefresh(async () => {
|
||||
return await servers.listServers()
|
||||
}),
|
||||
createServer: (body: DtoCreateServerRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await servers.createServer({ body })
|
||||
}),
|
||||
getServer: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
return await servers.getServer({ id })
|
||||
}),
|
||||
updateServer: (id: string, body: DtoUpdateServerRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await servers.updateServer({ id, body })
|
||||
}),
|
||||
deleteServer: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
await servers.deleteServer({ id })
|
||||
}),
|
||||
}
|
||||
Reference in New Issue
Block a user