diff --git a/db/db.go b/db/db.go index cdc056d8b..165765b80 100644 --- a/db/db.go +++ b/db/db.go @@ -1237,6 +1237,13 @@ func (db database) UpdateBountyPayment(b Bounty) (Bounty, error) { return b, nil } +func (db database) UpdateBountyCompleted(b Bounty) (Bounty, error) { + db.db.Model(&b).Where("created", b.Created).Updates(map[string]interface{}{ + "completed": b.Completed, + }) + return b, nil +} + func (db database) GetPeopleForNewTicket(languages []interface{}) ([]Person, error) { ms := []Person{} diff --git a/handlers/bounty.go b/handlers/bounty.go index 1ffe7afcf..7fb908fbc 100644 --- a/handlers/bounty.go +++ b/handlers/bounty.go @@ -345,7 +345,7 @@ func UpdateCompletedStatus(w http.ResponseWriter, r *http.Request) { bounty.Completed = true bounty.CompletionDate = &now } - db.DB.UpdateBountyPayment(bounty) + db.DB.UpdateBountyCompleted(bounty) } w.WriteHeader(http.StatusOK) json.NewEncoder(w).Encode(bounty) @@ -388,6 +388,7 @@ func (h *bountyHandler) GenerateBountyResponse(bounties []db.Bounty) []db.Bounty OrgUuid: bounty.OrgUuid, Updated: bounty.Updated, CodingLanguages: bounty.CodingLanguages, + Completed: bounty.Completed, }, Assignee: db.Person{ ID: assignee.ID,