Rename issue action to match patch
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
parent
24f1de980e
commit
f90f714fcf
|
|
@ -160,7 +160,7 @@ impl Issue {
|
||||||
pub fn apply(&mut self, ops: impl IntoIterator<Item = Op>) -> Result<(), Error> {
|
pub fn apply(&mut self, ops: impl IntoIterator<Item = Op>) -> Result<(), Error> {
|
||||||
for op in ops {
|
for op in ops {
|
||||||
match op.action {
|
match op.action {
|
||||||
Action::Title { title } => {
|
Action::Edit { title } => {
|
||||||
self.title.set(title, op.clock);
|
self.title.set(title, op.clock);
|
||||||
}
|
}
|
||||||
Action::Lifecycle { state } => {
|
Action::Lifecycle { state } => {
|
||||||
|
|
@ -198,8 +198,8 @@ impl Deref for Issue {
|
||||||
|
|
||||||
impl store::Transaction<Issue> {
|
impl store::Transaction<Issue> {
|
||||||
/// Set the issue title.
|
/// Set the issue title.
|
||||||
pub fn title(&mut self, title: impl ToString) -> OpId {
|
pub fn edit(&mut self, title: impl ToString) -> OpId {
|
||||||
self.push(Action::Title {
|
self.push(Action::Edit {
|
||||||
title: title.to_string(),
|
title: title.to_string(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -391,7 +391,7 @@ impl<'a> Issues<'a> {
|
||||||
) -> Result<IssueMut<'a, 'g>, Error> {
|
) -> Result<IssueMut<'a, 'g>, Error> {
|
||||||
let (id, issue, clock) =
|
let (id, issue, clock) =
|
||||||
Transaction::initial("Create issue", &mut self.raw, signer, |tx| {
|
Transaction::initial("Create issue", &mut self.raw, signer, |tx| {
|
||||||
tx.title(title);
|
tx.edit(title);
|
||||||
tx.comment(description);
|
tx.comment(description);
|
||||||
tx.tag(tags.to_owned(), []);
|
tx.tag(tags.to_owned(), []);
|
||||||
})?;
|
})?;
|
||||||
|
|
@ -416,7 +416,7 @@ impl<'a> Issues<'a> {
|
||||||
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
|
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
|
||||||
#[serde(tag = "type", rename_all = "camelCase")]
|
#[serde(tag = "type", rename_all = "camelCase")]
|
||||||
pub enum Action {
|
pub enum Action {
|
||||||
Title { title: String },
|
Edit { title: String },
|
||||||
Lifecycle { state: State },
|
Lifecycle { state: State },
|
||||||
Tag { add: Vec<Tag>, remove: Vec<Tag> },
|
Tag { add: Vec<Tag>, remove: Vec<Tag> },
|
||||||
Thread { action: thread::Action },
|
Thread { action: thread::Action },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue