mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-18 19:30:27 +08:00
Add missing readme_handler endpoint
This commit is contained in:
@@ -72,6 +72,7 @@ pub fn router(ctx: Context) -> Router {
|
||||
"/activity_by_patch",
|
||||
post(activity_patch_handler::<radicle::patch::Action, models::patch::Action>),
|
||||
)
|
||||
.route("/repo_readme", post(readme_handler))
|
||||
.route("/repo_tree", post(tree_handler))
|
||||
.route("/repo_blob", post(blob_handler))
|
||||
.route("/get_diff", post(diff_handler))
|
||||
@@ -172,6 +173,20 @@ struct DiffBody {
|
||||
pub options: types::cobs::diff::DiffOptions,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct ReadmeBody {
|
||||
pub rid: identity::RepoId,
|
||||
}
|
||||
|
||||
async fn readme_handler(
|
||||
State(ctx): State<Context>,
|
||||
Json(ReadmeBody { rid }): Json<ReadmeBody>,
|
||||
) -> impl IntoResponse {
|
||||
let readme = ctx.repo_readme(rid, None)?;
|
||||
|
||||
Ok::<_, Error>(Json(readme))
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct TreeBody {
|
||||
pub rid: identity::RepoId,
|
||||
|
||||
Reference in New Issue
Block a user