Files
autoglue/ui/src/api/actions.ts
allanice001 dac28d3ea5 feat: move jobs to action based
Signed-off-by: allanice001 <allanice001@gmail.com>
2025-12-26 00:30:46 +00:00

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,
})
}),
}