@@ -69,7 +69,7 @@ impl PartialOrd for NoteDataEntry {
69
69
}
70
70
}
71
71
72
- #[ derive( Debug , PartialEq , Eq , serde:: Serialize , serde:: Deserialize , Default ) ]
72
+ #[ derive( Debug , PartialEq , Eq , serde:: Serialize , serde:: Deserialize , Default , Clone ) ]
73
73
struct NoteData {
74
74
entries_by_url : HashMap < String , NoteDataEntry > ,
75
75
}
@@ -122,9 +122,11 @@ pub(super) async fn handle_command(
122
122
cmd : NoteCommand ,
123
123
) -> anyhow:: Result < ( ) > {
124
124
let issue = event. issue ( ) . unwrap ( ) ;
125
- let e = EditIssueBody :: new ( & issue, "SUMMARY" ) ;
126
125
127
- let mut current: NoteData = e. current_data ( ) . unwrap_or_default ( ) ;
126
+ let mut client = ctx. db . get ( ) . await ;
127
+ let mut e: EditIssueBody < ' _ , NoteData > =
128
+ EditIssueBody :: load ( & mut client, & issue, "SUMMARY" ) . await ?;
129
+ let current = e. data_mut ( ) ;
128
130
129
131
let comment_url = String :: from ( event. html_url ( ) . unwrap ( ) ) ;
130
132
let author = event. user ( ) . login . to_owned ( ) ;
@@ -158,7 +160,7 @@ pub(super) async fn handle_command(
158
160
let new_markdown = current. to_markdown ( & ctx. username ) ;
159
161
log:: debug!( "New MD: {:#?}" , new_markdown) ;
160
162
161
- e. apply ( & ctx. github , new_markdown, current ) . await ?;
163
+ e. apply ( & ctx. github , new_markdown) . await ?;
162
164
163
165
Ok ( ( ) )
164
166
}
0 commit comments