1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: view details of unknown projects on dashboard

This commit is contained in:
Ferdinand Mütsch
2023-04-03 20:30:23 +02:00
parent ca3320b174
commit 083fbf8633
9 changed files with 1269 additions and 1258 deletions

View File

@@ -1,6 +1,7 @@
package repositories
import (
"github.com/duke-git/lancet/v2/slice"
conf "github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"gorm.io/gorm"
@@ -89,7 +90,13 @@ func (r *HeartbeatRepository) GetAllWithinByFilters(from, to time.Time, user *mo
Order("time asc")
for col, vals := range filterMap {
q = q.Where(col+" in ?", vals)
q = q.Where(col+" in ?", slice.Map[string, string](vals, func(i int, val string) string {
// query for "unknown" projects, languages, etc.
if val == "-" {
return ""
}
return val
}))
}
if err := q.Find(&heartbeats).Error; err != nil {