Skip to content

Commit

Permalink
added completed to bounty response
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Apr 8, 2024
1 parent ce569ae commit 064ca81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}

Expand Down
3 changes: 2 additions & 1 deletion handlers/bounty.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 064ca81

Please sign in to comment.