add log filters for project group, project and item.
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
+14
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/gissleh/stufflog/internal/slerrors"
|
||||
"github.com/gissleh/stufflog/models"
|
||||
"github.com/gissleh/stufflog/services"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -38,6 +39,19 @@ func Log(g *gin.RouterGroup, db database.Database) {
|
||||
filter.MaxTime = &maxTime
|
||||
}
|
||||
|
||||
if value := c.Query("groups"); value != "" {
|
||||
filter.ProjectGroupIDs = strings.Split(value, ",")
|
||||
}
|
||||
if value := c.Query("projects"); value != "" {
|
||||
filter.ProjectIDs = strings.Split(value, ",")
|
||||
}
|
||||
if value := c.Query("items"); value != "" {
|
||||
filter.ItemIDs = strings.Split(value, ",")
|
||||
}
|
||||
if value := c.Query("tasks"); value != "" {
|
||||
filter.TaskIDs = strings.Split(value, ",")
|
||||
}
|
||||
|
||||
return l.ListLogs(c, filter)
|
||||
}))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user