Skip to content

Commit

Permalink
Merge pull request #558 from stakwork/fix/price_to_meet
Browse files Browse the repository at this point in the history
Fix/price to meet
  • Loading branch information
Evanfeenstra committed May 30, 2023
2 parents ab7c565 + c0df48b commit 4d98fd9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ func (db database) CreateOrEditPerson(m Person) (Person, error) {
if m.GithubIssues == nil {
m.GithubIssues = map[string]interface{}{}
}
if m.PriceToMeet == 0 {
updatePriceToMeet := make(map[string]interface{})
updatePriceToMeet["price_to_meet"] = 0

db.db.Model(&m).Where("id = ?", m.ID).UpdateColumns(&updatePriceToMeet)
}

if db.db.Model(&m).Where("id = ?", m.ID).Updates(&m).RowsAffected == 0 {
db.db.Create(&m)
Expand Down

0 comments on commit 4d98fd9

Please sign in to comment.