From 8ef3264b9391625ecce9929db577406ea7829790 Mon Sep 17 00:00:00 2001 From: elraphty Date: Mon, 8 Apr 2024 19:39:21 +0100 Subject: [PATCH] updated completion_date update --- db/db.go | 2 ++ handlers/bounty.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/db/db.go b/db/db.go index 165765b80..314dc45fc 100644 --- a/db/db.go +++ b/db/db.go @@ -1234,6 +1234,7 @@ func (db database) UpdateBountyPayment(b Bounty) (Bounty, error) { db.db.Model(&b).Where("created", b.Created).Updates(map[string]interface{}{ "paid": b.Paid, }) + db.db.Model(&b).Where("created", b.Created).Updates(b) return b, nil } @@ -1241,6 +1242,7 @@ func (db database) UpdateBountyCompleted(b Bounty) (Bounty, error) { db.db.Model(&b).Where("created", b.Created).Updates(map[string]interface{}{ "completed": b.Completed, }) + db.db.Model(&b).Where("created", b.Created).Updates(b) return b, nil } diff --git a/handlers/bounty.go b/handlers/bounty.go index 7fb908fbc..7ef6bd60d 100644 --- a/handlers/bounty.go +++ b/handlers/bounty.go @@ -342,8 +342,8 @@ func UpdateCompletedStatus(w http.ResponseWriter, r *http.Request) { now := time.Now() // set bounty as completed if !bounty.Paid && !bounty.Completed { - bounty.Completed = true bounty.CompletionDate = &now + bounty.Completed = true } db.DB.UpdateBountyCompleted(bounty) }