Skip to content

Commit 20ee406

Browse files
Fix comment IDs in rendered templates
1 parent f9d84fa commit 20ee406

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/server.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,17 @@ mod html {
6363
let record = json!({
6464
"disposition": fcp.disposition,
6565
"issue": issue,
66-
"statusComment": status_comment,
66+
"statusComment": {
67+
"id": status_comment.id as u32
68+
},
6769
"pendingReviewers": pending_reviewers,
68-
"pendingConcerns": concerns,
70+
"pendingConcerns": concerns.into_iter().map(|c| {
71+
json!({
72+
"name": c.0.clone(),
73+
"commentId": c.1.id as u32,
74+
"login": c.2.login.clone(),
75+
})
76+
}).collect::<Vec<_>>(),
6977
});
7078

7179
for label in issue.labels.iter().filter(|l| l.starts_with("T-")).cloned() {

src/templates/fcp.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<ul><li>
2222
{{#each fcp.pendingConcerns as |r| }}
23-
<a href="https://github.com/{{ fcp.issue.repository }}/issues/{{ fcp.issue.number }}#issuecomment-{{ r.[1].id }}">{{ r.[0] }} (by {{ r.[2].login }})</a>&nbsp;
23+
<a href="https://github.com/{{ fcp.issue.repository }}/issues/{{ fcp.issue.number }}#issuecomment-{{ r.commentId }}">{{ r.name }} (by {{ r.login }})</a>&nbsp;
2424
{{else}}
2525
no pending concerns
2626
{{/each}}

0 commit comments

Comments
 (0)