Skip to content

Commit

Permalink
feat: Improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
0michalsokolowski0 committed Aug 26, 2024
1 parent 58d175c commit dff92d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
7 changes: 1 addition & 6 deletions internal/cmd/stack/local_preview.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,7 @@ func localPreview() cli.ActionFunc {
fmt.Println("You have successfully created a local preview run!")

if cliCtx.Bool(flagPrioritizeRun.Name) {
var prioritizeMutation struct {
SetRunPriority struct {
ID string `graphql:"id"`
} `graphql:"runPrioritizeSet(stack: $stackId, run: $runId, prioritize: $prioritize)"`
}

var prioritizeMutation setRunPriorityMutation
variables := map[string]interface{}{
"stackId": graphql.ID(stack.ID),
"runId": graphql.ID(triggerMutation.RunProposeLocalWorkspace.ID),
Expand Down
12 changes: 7 additions & 5 deletions internal/cmd/stack/run_prioritize.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ import (
"github.com/urfave/cli/v2"
)

type setRunPriorityMutation struct {
SetRunPriority struct {
ID string `graphql:"id"`
} `graphql:"runPrioritizeSet(stack: $stackId, run: $runId, prioritize: $prioritize)"`
}

func runPrioritize(cliCtx *cli.Context) error {
stackID, err := getStackID(cliCtx)
if err != nil {
return err
}
runID := cliCtx.String(flagRequiredRun.Name)

var mutation struct {
SetRunPriority struct {
ID string `graphql:"id"`
} `graphql:"runPrioritizeSet(stack: $stackId, run: $runId, prioritize: $prioritize)"`
}
var mutation setRunPriorityMutation

variables := map[string]interface{}{
"stackId": graphql.ID(stackID),
Expand Down

0 comments on commit dff92d2

Please sign in to comment.