radicle: Rename many more methods using new naming

This commit is contained in:
cloudhead
2023-12-06 10:02:00 +01:00
parent 8319fde08f
commit 4816a4de5f
5 changed files with 20 additions and 20 deletions
+3 -3
View File
@@ -64,7 +64,7 @@ impl Context {
let issues = issue::Issues::open(&repo)?.counts()?;
let patches = patch::Patches::open(&repo)?.counts()?;
let db = &self.profile.database()?;
let trackings = db.count(&id).unwrap_or_default();
let seeding = db.count(&id).unwrap_or_default();
Ok(project::Info {
payload,
@@ -74,7 +74,7 @@ impl Context {
issues,
patches,
id,
trackings,
seeding,
})
}
@@ -213,7 +213,7 @@ mod project {
pub patches: cob::patch::PatchCounts,
pub issues: cob::issue::IssueCounts,
pub id: Id,
pub trackings: usize,
pub seeding: usize,
}
}
+5 -5
View File
@@ -78,7 +78,7 @@ async fn delegates_projects_handler(
};
let delegates = id.doc.delegates;
let trackings = db.count(&id.rid).unwrap_or_default();
let seeding = db.count(&id.rid).unwrap_or_default();
Some(Info {
payload,
@@ -88,7 +88,7 @@ async fn delegates_projects_handler(
issues,
patches,
id: id.rid,
trackings,
seeding,
})
})
.skip(page * per_page)
@@ -146,7 +146,7 @@ mod routes {
"closed": 0,
},
"id": "rad:zLuTzcmoWMcdK37xqArS8eckp9vK",
"trackings": 0,
"seeding": 0,
},
{
"name": "hello-world",
@@ -168,7 +168,7 @@ mod routes {
"closed": 0,
},
"id": RID,
"trackings": 0,
"seeding": 0,
},
])
);
@@ -207,7 +207,7 @@ mod routes {
"closed": 0,
},
"id": RID,
"trackings": 0,
"seeding": 0,
}
])
);
+5 -5
View File
@@ -51,13 +51,13 @@ async fn node_handler(State(ctx): State<Context>) -> impl IntoResponse {
Ok::<_, Error>(Json(response))
}
/// Return local tracking repos information.
/// Return local repo policies information.
/// `GET /node/policies/repos`
async fn node_policies_repos_handler(State(ctx): State<Context>) -> impl IntoResponse {
let tracking = ctx.profile.tracking()?;
let policies = ctx.profile.policies()?;
let mut repos = Vec::new();
for policy::Repo { id, scope, policy } in tracking.repo_policies()? {
for policy::Repo { id, scope, policy } in policies.seed_policies()? {
repos.push(json!({
"id": id,
"scope": scope,
@@ -68,7 +68,7 @@ async fn node_policies_repos_handler(State(ctx): State<Context>) -> impl IntoRes
Ok::<_, Error>(Json(repos))
}
/// Track a new repo.
/// Seed a new repo.
/// `PUT /node/policies/repos/:rid`
async fn node_policies_seed_handler(
State(ctx): State<Context>,
@@ -90,7 +90,7 @@ async fn node_policies_seed_handler(
Ok::<_, Error>((StatusCode::OK, Json(json!({ "success": true }))))
}
/// Untrack a repo.
/// Unseed a repo.
/// `DELETE /node/policies/repos/:rid`
async fn node_policies_unseed_handler(
State(ctx): State<Context>,
+6 -6
View File
@@ -119,7 +119,7 @@ async fn project_root_handler(
return None;
};
let delegates = id.doc.delegates;
let trackings = db.count(&id.rid).unwrap_or_default();
let seeding = db.count(&id.rid).unwrap_or_default();
Some(Info {
payload,
@@ -129,7 +129,7 @@ async fn project_root_handler(
issues,
patches,
id: id.rid,
trackings,
seeding,
})
})
.skip(page * per_page)
@@ -994,7 +994,7 @@ mod routes {
"closed": 0,
},
"id": "rad:zLuTzcmoWMcdK37xqArS8eckp9vK",
"trackings": 0,
"seeding": 0,
},
{
"name": "hello-world",
@@ -1016,7 +1016,7 @@ mod routes {
"closed": 0,
},
"id": RID,
"trackings": 0,
"seeding": 0,
},
])
);
@@ -1051,7 +1051,7 @@ mod routes {
"closed": 0,
},
"id": RID,
"trackings": 0,
"seeding": 0,
}
])
);
@@ -1086,7 +1086,7 @@ mod routes {
"closed": 0,
},
"id": RID,
"trackings": 0,
"seeding": 0,
})
);
}
+1 -1
View File
@@ -96,7 +96,7 @@ fn seed_with_signer<G: Signer>(dir: &Path, profile: radicle::Profile, signer: &G
crate::logger::init().ok();
profile.tracking_mut().unwrap();
profile.policies_mut().unwrap();
profile.database_mut().unwrap(); // Create the database.
let workdir = dir.join("hello-world-private");