Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into Refactor-TestCreateConnect…
Browse files Browse the repository at this point in the history
…ionCode-UT
  • Loading branch information
Shoaibdev7 committed Jun 27, 2024
2 parents 8a72f0b + 72bb08b commit 61ab515
Show file tree
Hide file tree
Showing 3 changed files with 202 additions and 112 deletions.
10 changes: 9 additions & 1 deletion db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -1357,10 +1357,18 @@ func (db database) UpdateBot(uuid string, u map[string]interface{}) bool {

func (db database) GetAllTribes() []Tribe {
ms := []Tribe{}
db.db.Where("(deleted = 'f' OR de leted is null)").Find(&ms)
db.db.Where("(deleted = 'f' OR deleted is null)").Find(&ms)
return ms
}

func (db database) DeleteTribe() (bool, error) {
result := db.db.Exec("DELETE FROM tribes")
if result.Error != nil {
return false, result.Error
}
return true, nil
}

func (db database) GetTribesTotal() int64 {
var count int64
db.db.Model(&Tribe{}).Where("deleted = 'false' OR deleted is null").Count(&count)
Expand Down
Loading

0 comments on commit 61ab515

Please sign in to comment.