mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 21:00:06 +01:00
31 lines
864 B
TypeScript
31 lines
864 B
TypeScript
import { withRefresh } from "@/api/with-refresh.ts"
|
|
import type { DtoCreateActionRequest, DtoUpdateActionRequest } from "@/sdk"
|
|
import { makeActionsApi } from "@/sdkClient.ts"
|
|
|
|
const actions = makeActionsApi()
|
|
export const actionsApi = {
|
|
listActions: () =>
|
|
withRefresh(async () => {
|
|
return await actions.listActions()
|
|
}),
|
|
createAction: (body: DtoCreateActionRequest) =>
|
|
withRefresh(async () => {
|
|
return await actions.createAction({
|
|
dtoCreateActionRequest: body,
|
|
})
|
|
}),
|
|
updateAction: (id: string, body: DtoUpdateActionRequest) =>
|
|
withRefresh(async () => {
|
|
return await actions.updateAction({
|
|
actionID: id,
|
|
dtoUpdateActionRequest: body,
|
|
})
|
|
}),
|
|
deleteAction: (id: string) =>
|
|
withRefresh(async () => {
|
|
await actions.deleteAction({
|
|
actionID: id,
|
|
})
|
|
}),
|
|
}
|