WEB - ADD COMMENTS ON ISSUES

This commit is contained in:
Ine Maria Nilssen Aanonsen
2026-02-20 17:02:10 +01:00
parent bb059ad8d8
commit 4ad08b3720
7 changed files with 109 additions and 99 deletions

View File

@@ -13,16 +13,9 @@ type CommentForm struct {
}
func ListComments(w http.ResponseWriter, r *http.Request) {
issue := r.Context().Value(issueKey).(*models.Issue)
svc := Services(r)
comments := r.Context().Value(commentsKey).([]models.Comment)
hx := HTMX(r)
comments, err := svc.Beads.GetComments(r.Context(), issue.ID)
if err != nil {
http.Error(w, "Failed to retrieve comments: "+err.Error(), http.StatusInternalServerError)
return
}
if hx.IsHxRequest() {
components.CommentList(components.CommentListProps{
Comments: comments,