Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli/patch: move comment actions
Fintan Halpenny committed 6 months ago
commit 69971971b9a753d9e3ee99605496514a169b1c8a
parent e404f1038f461264f9395742ef74f5b710bef54a
1 file changed +35 -35
modified crates/radicle-cli/src/commands/patch.rs
@@ -962,6 +962,41 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
                &profile,
            )?;
        }
+
        Operation::CommentEdit {
+
            revision_id,
+
            comment_id,
+
            message,
+
        } => {
+
            let comment = comment_id.resolve(&repository.backend)?;
+
            comment::edit::run(
+
                revision_id,
+
                comment,
+
                message,
+
                options.quiet,
+
                &repository,
+
                &profile,
+
            )?;
+
        }
+
        Operation::CommentRedact {
+
            revision_id,
+
            comment_id,
+
        } => {
+
            let comment = comment_id.resolve(&repository.backend)?;
+
            comment::redact::run(revision_id, comment, &repository, &profile)?;
+
        }
+
        Operation::CommentReact {
+
            revision_id,
+
            comment_id,
+
            reaction,
+
            undo,
+
        } => {
+
            let comment = comment_id.resolve(&repository.backend)?;
+
            if undo {
+
                comment::react::run(revision_id, comment, reaction, false, &repository, &profile)?;
+
            } else {
+
                comment::react::run(revision_id, comment, reaction, true, &repository, &profile)?;
+
            }
+
        }
        Operation::Review {
            patch_id,
            revision_id,
@@ -1058,41 +1093,6 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
            };
            cache::run(mode, &profile)?;
        }
-
        Operation::CommentEdit {
-
            revision_id,
-
            comment_id,
-
            message,
-
        } => {
-
            let comment = comment_id.resolve(&repository.backend)?;
-
            comment::edit::run(
-
                revision_id,
-
                comment,
-
                message,
-
                options.quiet,
-
                &repository,
-
                &profile,
-
            )?;
-
        }
-
        Operation::CommentRedact {
-
            revision_id,
-
            comment_id,
-
        } => {
-
            let comment = comment_id.resolve(&repository.backend)?;
-
            comment::redact::run(revision_id, comment, &repository, &profile)?;
-
        }
-
        Operation::CommentReact {
-
            revision_id,
-
            comment_id,
-
            reaction,
-
            undo,
-
        } => {
-
            let comment = comment_id.resolve(&repository.backend)?;
-
            if undo {
-
                comment::react::run(revision_id, comment, reaction, false, &repository, &profile)?;
-
            } else {
-
                comment::react::run(revision_id, comment, reaction, true, &repository, &profile)?;
-
            }
-
        }
        Operation::React {
            revision_id,
            reaction,