//native
import * as wmill from "windmill-client"
// windmill-client errors only carry the status text: throw the response body, which says why
wmill.OpenAPI.interceptors.response.use(async (response) => {
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return response
})
/**
* Cancel Job
* Cancel a queued or running job.
*/
export async function main(id: string, reason: string | undefined) {
return await wmill.JobService.cancelQueuedJob({
workspace: wmill.getWorkspace(),
id,
requestBody: { reason: reason || undefined },
})
}
Submitted by hugo989 5 hours ago