httpd: Implement `EditCodeComment` in route
This commit is contained in:
parent
369fc7637c
commit
d6e8f0c53e
|
|
@ -647,8 +647,12 @@ async fn patch_update_handler(
|
|||
patch::Action::EditReview { review, summary } => {
|
||||
patch.edit_review(review, summary, &signer)?;
|
||||
}
|
||||
patch::Action::EditCodeComment { .. } => {
|
||||
todo!()
|
||||
patch::Action::EditCodeComment {
|
||||
review,
|
||||
comment,
|
||||
body,
|
||||
} => {
|
||||
patch.edit_code_comment(review, comment, body, &signer)?;
|
||||
}
|
||||
patch::Action::Tag { add, remove } => {
|
||||
patch.tag(add, remove, &signer)?;
|
||||
|
|
|
|||
|
|
@ -1078,6 +1078,20 @@ impl store::Transaction<Patch> {
|
|||
})
|
||||
}
|
||||
|
||||
/// Edit comment on code.
|
||||
pub fn edit_code_comment<S: ToString>(
|
||||
&mut self,
|
||||
review: EntryId,
|
||||
comment: EntryId,
|
||||
body: S,
|
||||
) -> Result<(), store::Error> {
|
||||
self.push(Action::EditCodeComment {
|
||||
review,
|
||||
comment,
|
||||
body: body.to_string(),
|
||||
})
|
||||
}
|
||||
|
||||
/// Review a patch revision.
|
||||
pub fn review(
|
||||
&mut self,
|
||||
|
|
@ -1255,6 +1269,19 @@ impl<'a, 'g> PatchMut<'a, 'g> {
|
|||
})
|
||||
}
|
||||
|
||||
/// Edit comment on code.
|
||||
pub fn edit_code_comment<G: Signer, S: ToString>(
|
||||
&mut self,
|
||||
review: EntryId,
|
||||
comment: EntryId,
|
||||
body: S,
|
||||
signer: &G,
|
||||
) -> Result<EntryId, Error> {
|
||||
self.transaction("Edit code comment", signer, |tx| {
|
||||
tx.edit_code_comment(review, comment, body)
|
||||
})
|
||||
}
|
||||
|
||||
/// Review a patch revision.
|
||||
pub fn review<G: Signer>(
|
||||
&mut self,
|
||||
|
|
|
|||
Loading…
Reference in New Issue