Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Reduce pub accessors in patch and issue cob structs
Sebastian Martinez committed 3 years ago
commit fff45817bcd9c1b3cc3d8f0cc00ca963e678b98f
parent f7fc778c3b26861905ab00c2367a99a7919f31bf
1 file changed +6 -7
modified radicle-httpd/src/api/json.rs
@@ -121,15 +121,14 @@ pub(crate) fn patch(id: PatchId, patch: Patch, repo: &git::Repository) -> Value
            json!({
                "id": id,
                "description": rev.description(),
-
                "base": rev.base,
-
                "oid": rev.oid,
-
                "refs": get_refs(repo, patch.author().id(), &rev.oid).unwrap_or(vec![]),
+
                "base": rev.base(),
+
                "oid": rev.head(),
+
                "refs": get_refs(repo, patch.author().id(), &rev.head()).unwrap_or(vec![]),
                "merges": rev.merges().collect::<Vec<_>>(),
-
                "discussions": rev.discussion
-
                  .comments()
-
                  .map(|(id, comment)| Comment::new(id, comment, &rev.discussion))
+
                "discussions": rev.discussion().comments()
+
                  .map(|(id, comment)| Comment::new(id, comment, rev.discussion()))
                  .collect::<Vec<_>>(),
-
                "timestamp": rev.timestamp,
+
                "timestamp": rev.timestamp(),
                "reviews": rev.reviews().collect::<Vec<_>>(),
            })
        }).collect::<Vec<_>>(),