mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 12:50:05 +01:00
33 lines
1.0 KiB
TypeScript
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,
|
|
})
|
|
}),
|
|
}
|