Fix sorting on multiple ticket fields (#412)

This commit is contained in:
Jonas Plum
2022-08-21 22:23:27 +02:00
committed by GitHub
parent 2b7be7c212
commit fd8e793361
4 changed files with 130 additions and 34 deletions

View File

@@ -571,7 +571,7 @@ func (db *Database) TicketCount(ctx context.Context, typequery, filterquery stri
}
func sortQuery(paramsSort []string, paramsDesc []bool, bindVars map[string]any) string {
sort := ""
sortQuery := ""
if len(paramsSort) > 0 {
var sorts []string
for i, column := range paramsSort {
@@ -582,10 +582,10 @@ func sortQuery(paramsSort []string, paramsDesc []bool, bindVars map[string]any)
sorts = append(sorts, colsort)
bindVars[fmt.Sprintf("column%d", i)] = column
}
sort = "SORT " + strings.Join(sorts, ", ")
sortQuery = "SORT " + strings.Join(sorts, ", ")
}
return sort
return sortQuery
}
func mergeMaps(a map[string]any, b map[string]any) map[string]any {