WEB - ADD COMMENTS ON ISSUES
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user