Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Commit

Permalink
Add filter for workload type (#321)
Browse files Browse the repository at this point in the history
* add filter for workload type

* resolve pr comment
  • Loading branch information
DylanVerstraete authored May 31, 2021
1 parent 9c6f130 commit 1ce2486
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/workloads/types/workload.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ func ApplyQueryFilterWorkload(r *http.Request, filter WorkloadFilter) (WorkloadF
if err != nil {
return nil, errors.Wrap(err, "next_action should be an integer")
}
filter = filter.WithNextAction(generated.NextActionEnum(nextAction))
filter = filter.WithNextAction(workloads.NextActionEnum(nextAction))
}
sWorkloadType := r.FormValue("workload_type")
if len(sWorkloadType) != 0 {
workloadType, err := strconv.ParseUint(sWorkloadType, 10, 8)
if err != nil {
return nil, errors.Wrap(err, "workload_type should be an integer")
}
filter = filter.WithWorkloadType(workloads.WorkloadTypeEnum(workloadType))
}
return filter, nil
}
Expand Down

0 comments on commit 1ce2486

Please sign in to comment.