From d04d9d7d1fb0329b62673ee9ec25b1a2081316ee Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Tue, 30 Apr 2024 15:49:03 +0200 Subject: [PATCH] httpd: Add threshold to project info --- radicle-httpd/src/api.rs | 2 ++ radicle-httpd/src/api/v1/delegates.rs | 3 +++ radicle-httpd/src/api/v1/projects.rs | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/radicle-httpd/src/api.rs b/radicle-httpd/src/api.rs index 04bb9f33..0de97c4e 100644 --- a/radicle-httpd/src/api.rs +++ b/radicle-httpd/src/api.rs @@ -79,6 +79,7 @@ impl Context { Ok(project::Info { payload, delegates, + threshold: doc.threshold, visibility: doc.visibility, head, issues, @@ -238,6 +239,7 @@ mod project { #[serde(flatten)] pub payload: Project, pub delegates: Vec, + pub threshold: usize, pub visibility: Visibility, pub head: Oid, pub patches: cob::patch::PatchCounts, diff --git a/radicle-httpd/src/api/v1/delegates.rs b/radicle-httpd/src/api/v1/delegates.rs index e7cd6d5e..bfd53bb5 100644 --- a/radicle-httpd/src/api/v1/delegates.rs +++ b/radicle-httpd/src/api/v1/delegates.rs @@ -94,6 +94,7 @@ async fn delegates_projects_handler( Some(Info { payload, delegates, + threshold: id.doc.threshold, visibility: id.doc.visibility, head, issues, @@ -150,6 +151,7 @@ mod routes { "alias": "seed" } ], + "threshold": 1, "visibility": { "type": "public" }, @@ -199,6 +201,7 @@ mod routes { "alias": "seed" } ], + "threshold": 1, "visibility": { "type": "public" }, diff --git a/radicle-httpd/src/api/v1/projects.rs b/radicle-httpd/src/api/v1/projects.rs index 5dbb22d1..491e09fb 100644 --- a/radicle-httpd/src/api/v1/projects.rs +++ b/radicle-httpd/src/api/v1/projects.rs @@ -154,6 +154,7 @@ async fn project_root_handler( payload, delegates, head, + threshold: info.doc.threshold, visibility: info.doc.visibility, issues, patches, @@ -1015,6 +1016,7 @@ mod routes { "alias": "seed" } ], + "threshold": 1, "visibility": { "type": "public" }, @@ -1055,6 +1057,7 @@ mod routes { "alias": "seed" } ], + "threshold": 1, "visibility": { "type": "public" }, @@ -1095,6 +1098,7 @@ mod routes { "alias": "seed" } ], + "threshold": 1, "visibility": { "type": "public" },