Files
autoglue/ui/src/api/annotations.ts
allanice001 d163a050d8 feat: load balancers ui
Signed-off-by: allanice001 <allanice001@gmail.com>
2025-11-17 15:16:20 +00:00

33 lines
1.0 KiB
TypeScript

import { withRefresh } from "@/api/with-refresh.ts"
import type { DtoCreateAnnotationRequest, DtoUpdateAnnotationRequest } from "@/sdk"
import { makeAnnotationsApi } from "@/sdkClient.ts"
const annotations = makeAnnotationsApi()
export const annotationsApi = {
listAnnotations: () =>
withRefresh(async () => {
return await annotations.listAnnotations()
}),
createAnnotation: (body: DtoCreateAnnotationRequest) =>
withRefresh(async () => {
return await annotations.createAnnotation({
dtoCreateAnnotationRequest: body,
})
}),
getAnnotation: (id: string) =>
withRefresh(async () => {
return await annotations.getAnnotation({ id })
}),
deleteAnnotation: (id: string) =>
withRefresh(async () => {
await annotations.deleteAnnotation({ id })
}),
updateAnnotation: (id: string, body: DtoUpdateAnnotationRequest) =>
withRefresh(async () => {
return await annotations.updateAnnotation({
id,
dtoUpdateAnnotationRequest: body,
})
}),
}