mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 12:50:05 +01:00
feat: add labels ui page
This commit is contained in:
29
ui/src/api/labels.ts
Normal file
29
ui/src/api/labels.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { withRefresh } from "@/api/with-refresh.ts"
|
||||
import type { DtoCreateLabelRequest, DtoUpdateLabelRequest } from "@/sdk"
|
||||
import { makeLabelsApi } from "@/sdkClient.ts"
|
||||
|
||||
|
||||
const labels = makeLabelsApi()
|
||||
|
||||
export const labelsApi = {
|
||||
listLabels: () =>
|
||||
withRefresh(async () => {
|
||||
return await labels.listLabels()
|
||||
}),
|
||||
createLabel: (body: DtoCreateLabelRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await labels.createLabel({ body })
|
||||
}),
|
||||
getLabel: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
return await labels.getLabel({ id })
|
||||
}),
|
||||
deleteLabel: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
await labels.deleteLabel({ id })
|
||||
}),
|
||||
updateLabel: (id: string, body: DtoUpdateLabelRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await labels.updateLabel({ id, body })
|
||||
}),
|
||||
}
|
||||
@@ -12,6 +12,10 @@ export const taintsApi = {
|
||||
withRefresh(async () => {
|
||||
return await taints.createTaint({ body })
|
||||
}),
|
||||
getTaint: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
return await taints.getTaint({ id })
|
||||
}),
|
||||
deleteTaint: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
await taints.deleteTaint({ id })
|
||||
|
||||
Reference in New Issue
Block a user