Change priority for WEB

This commit is contained in:
Moira Daniella A Sebastian
2026-03-16 18:30:15 +01:00
parent ba6d97550e
commit f51c41ec1b

View File

@@ -2,6 +2,7 @@ package handler
import (
"net/http"
"sort"
"strings"
"github.com/LazyBachelor/LazyPM/internal/models"
@@ -20,6 +21,11 @@ func DashboardHandler(w http.ResponseWriter, r *http.Request) {
return
}
// Sort issues by highest priority first (4 -> 0)
sort.Slice(issues, func(i, j int) bool {
return issues[i].Priority > issues[j].Priority
})
// Check if board view is requested
isBoardView := r.URL.Query().Get("board") == "true"