updating web to be compatible with main

This commit is contained in:
viljarb
2026-02-18 20:33:32 +01:00
parent b654fb5bd3
commit ed8a0d02ec
25 changed files with 3800 additions and 793 deletions

26
pkg/web/handler/index.go Normal file
View File

@@ -0,0 +1,26 @@
package handler
import (
"net/http"
"github.com/LazyBachelor/LazyPM/pkg/web/components"
"github.com/LazyBachelor/LazyPM/pkg/web/routes"
)
func IndexHandler(w http.ResponseWriter, r *http.Request) {
svc := Services(r)
issues, err := svc.Beads.AllIssues(r.Context())
if err != nil {
http.Error(w, "failed to retrieve issues", http.StatusInternalServerError)
return
}
props := routes.IndexProps{
IssueTable: components.IssueTableProps{
Issues: issues,
},
}
routes.Index(props).Render(r.Context(), w)
}