Skip to content

Commit a90ace6

Browse files
committed
Ignore 0 values for assignment search params
1 parent b6d42af commit a90ace6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/datastore/assignment.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ func (as *AssignmentStore) GetAssignments(p assignment.Params) (assignment.Assig
4545
paramsQuery := []string{}
4646
args := []interface{}{}
4747

48-
if p.WorkerID != "" {
48+
if p.WorkerID != "" && p.WorkerID != "0" {
4949
args = append(args, p.WorkerID)
5050
paramsQuery = append(paramsQuery, "worker_id=?")
5151
}
52-
if p.JobID != "" {
52+
if p.JobID != "" && p.JobID != "0" {
5353
args = append(args, p.JobID)
5454
paramsQuery = append(paramsQuery, "job_id=?")
5555
}
56-
if p.TaskID != "" {
56+
if p.TaskID != "" && p.TaskID != "0" {
5757
args = append(args, p.TaskID)
5858
paramsQuery = append(paramsQuery, "task_id=?")
5959
}

0 commit comments

Comments
 (0)