@@ -391,6 +391,8 @@ impl ZulipGitHubReference {
391
391
392
392
#[ derive( Debug , serde:: Deserialize ) ]
393
393
pub struct Comment {
394
+ pub id : u64 ,
395
+ pub node_id : String ,
394
396
#[ serde( deserialize_with = "opt_string" ) ]
395
397
pub body : String ,
396
398
pub html_url : String ,
@@ -581,24 +583,24 @@ impl Issue {
581
583
client : & GithubClient ,
582
584
id : u64 ,
583
585
new_body : & str ,
584
- ) -> anyhow:: Result < ( ) > {
586
+ ) -> anyhow:: Result < Comment > {
585
587
let comment_url = format ! ( "{}/issues/comments/{}" , self . repository( ) . url( client) , id) ;
586
588
#[ derive( serde:: Serialize ) ]
587
589
struct NewComment < ' a > {
588
590
body : & ' a str ,
589
591
}
590
- client
591
- . send_req (
592
+ let comment = client
593
+ . json (
592
594
client
593
595
. patch ( & comment_url)
594
596
. json ( & NewComment { body : new_body } ) ,
595
597
)
596
598
. await
597
599
. context ( "failed to edit comment" ) ?;
598
- Ok ( ( ) )
600
+ Ok ( comment )
599
601
}
600
602
601
- pub async fn post_comment ( & self , client : & GithubClient , body : & str ) -> anyhow:: Result < ( ) > {
603
+ pub async fn post_comment ( & self , client : & GithubClient , body : & str ) -> anyhow:: Result < Comment > {
602
604
#[ derive( serde:: Serialize ) ]
603
605
struct PostComment < ' a > {
604
606
body : & ' a str ,
@@ -608,11 +610,11 @@ impl Issue {
608
610
. strip_prefix ( "https://api.github.com" )
609
611
. expect ( "expected api host" ) ;
610
612
let comments_url = format ! ( "{}{comments_path}" , client. api_url) ;
611
- client
612
- . send_req ( client. post ( & comments_url) . json ( & PostComment { body } ) )
613
+ let comment = client
614
+ . json ( client. post ( & comments_url) . json ( & PostComment { body } ) )
613
615
. await
614
616
. context ( "failed to post comment" ) ?;
615
- Ok ( ( ) )
617
+ Ok ( comment )
616
618
}
617
619
618
620
pub async fn remove_label ( & self , client : & GithubClient , label : & str ) -> anyhow:: Result < ( ) > {
0 commit comments