Skip to content

Commit

Permalink
Fixed GetBountiesByDateRange query to handle multiple status
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulWahab3181 committed Jan 25, 2024
1 parent c251493 commit 8875cc7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions db/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,23 @@ func (db database) GetBountiesByDateRange(r PaymentDateRange, re *http.Request)

if open != "" && open == "true" {
openQuery = "AND assignee = '' AND paid != true"
assignedQuery = ""
}
if assingned != "" && assingned == "true" {
assignedQuery = "AND assignee != '' AND paid = false"
if open != "" && open == "true" {
assignedQuery = "OR assignee != '' AND paid != true"
} else {
assignedQuery = "AND assignee != '' AND paid != true"
}
}
if paid != "" && paid == "true" {
paidQuery = "AND paid = true"
if open != "" && open == "true" || assingned != "" && assingned == "true" {
paidQuery = "OR paid = true"
} else if open != "" && open == "true" && assingned == "" && assingned != "true" {
assignedQuery = ""
} else {
paidQuery = "AND paid = true"
}
}

if sortBy != "" && direction != "" {
Expand Down

0 comments on commit 8875cc7

Please sign in to comment.