From 04ec977be77250c3c1222b365b02d4a91a38132e Mon Sep 17 00:00:00 2001 From: elraphty Date: Wed, 28 Feb 2024 15:37:27 +0100 Subject: [PATCH] changed sort direction for created and assigned bounties --- db/db.go | 4 ++-- handlers/bounty.go | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/db/db.go b/db/db.go index bfa82960a..e03d0cd27 100644 --- a/db/db.go +++ b/db/db.go @@ -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) diff --git a/handlers/bounty.go b/handlers/bounty.go index aa8477edb..650661369 100644 --- a/handlers/bounty.go +++ b/handlers/bounty.go @@ -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) }