Skip to content

Commit

Permalink
changed sort direction for created and assigned bounties
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Feb 28, 2024
1 parent ed4eb86 commit 04ec977
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,9 @@ func (db database) GetAssignedBounties(r *http.Request) ([]Bounty, error) {
limitQuery := ""

if sortBy != "" && direction != "" {
orderQuery = "ORDER BY " + sortBy + " " + "DESC"
orderQuery = "ORDER BY " + sortBy + " " + direction
} else {
orderQuery = " ORDER BY paid DESC"
orderQuery = " ORDER BY paid ASC"
}
if offset >= 0 && limit != 0 {
limitQuery = fmt.Sprintf("LIMIT %d OFFSET %d", limit, offset)
Expand Down
3 changes: 3 additions & 0 deletions handlers/bounty.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ func UpdatePaymentStatus(w http.ResponseWriter, r *http.Request) {
if bounty.Paid {
bounty.CompletionDate = &now
bounty.MarkAsPaidDate = &now
if bounty.PaidDate == nil {
bounty.PaidDate = &now
}
}
db.DB.UpdateBountyPayment(bounty)
}
Expand Down

0 comments on commit 04ec977

Please sign in to comment.