-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: pause workflow state * feat: dont run paused workflows * feat: skipped paused * implement unpaused behavior for workflow runs * fix: frontend * fix: more frontend * fix: imports --------- Co-authored-by: Alexander Belanger <[email protected]>
- Loading branch information
1 parent
dd385c5
commit 7d7e43d
Showing
38 changed files
with
1,590 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package workflows | ||
|
||
import ( | ||
"github.com/labstack/echo/v4" | ||
|
||
"github.com/hatchet-dev/hatchet/api/v1/server/oas/gen" | ||
"github.com/hatchet-dev/hatchet/api/v1/server/oas/transformers" | ||
"github.com/hatchet-dev/hatchet/pkg/repository" | ||
"github.com/hatchet-dev/hatchet/pkg/repository/prisma/db" | ||
"github.com/hatchet-dev/hatchet/pkg/repository/prisma/dbsqlc" | ||
"github.com/hatchet-dev/hatchet/pkg/repository/prisma/sqlchelpers" | ||
) | ||
|
||
func (t *WorkflowService) WorkflowUpdate(ctx echo.Context, request gen.WorkflowUpdateRequestObject) (gen.WorkflowUpdateResponseObject, error) { | ||
tenant := ctx.Get("tenant").(*db.TenantModel) | ||
workflow := ctx.Get("workflow").(*dbsqlc.GetWorkflowByIdRow) | ||
|
||
opts := repository.UpdateWorkflowOpts{ | ||
IsPaused: request.Body.IsPaused, | ||
} | ||
|
||
updated, err := t.config.APIRepository.Workflow().UpdateWorkflow(ctx.Request().Context(), tenant.ID, sqlchelpers.UUIDToStr(workflow.Workflow.ID), &opts) | ||
|
||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
resp := transformers.ToWorkflowFromSQLC(updated) | ||
|
||
return gen.WorkflowUpdate200JSONResponse(*resp), nil | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.