Edits history of script submission #22581 for ' Resume Suspended Flow as Owner (windmill)'

  • bunnative
    One script reply has been approved by the moderators
    Ap­pro­ved
    //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
    })
    
    /**
     * Resume Suspended Flow as Owner
     * Approve a flow suspended on an approval step, as an owner of the flow or a workspace admin. The payload is passed to the flow as the resume value.
     */
    export async function main(
      id: string,
      resume_payload: { [key: string]: any } | undefined
    ) {
      return await wmill.JobService.resumeSuspendedFlowAsOwner({
        workspace: wmill.getWorkspace(),
        id,
        requestBody: resume_payload ?? {},
      })
    }
    

    Submitted by hugo989 14 days ago

  • bunnative
    //native
    
    import * as wmill from "windmill-client@1";
    
    export async function main(id: string, resumePayload?: object) {
      return wmill.JobService.resumeSuspendedFlowAsOwner({
        workspace: wmill.getWorkspace(),
        id,
        requestBody: resumePayload ?? {},
      });
    }
    

    Submitted by hugo989 148 days ago