From c0df48b3219287ac1d0a97673c1bf4a54292495f Mon Sep 17 00:00:00 2001 From: elraphty Date: Mon, 29 May 2023 23:28:07 +0100 Subject: [PATCH] fixed setting price to meet to 0 --- db/db.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/db.go b/db/db.go index e257bb798..5079ecfef 100644 --- a/db/db.go +++ b/db/db.go @@ -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)