mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Add notification endpoint stubs to test-http-api
This commit is contained in:
@@ -98,6 +98,9 @@ pub fn router(ctx: Context) -> Router {
|
||||
.route("/save_embed_by_bytes", post(save_embed_handler))
|
||||
.route("/save_embed_to_disk", post(save_embed_handler))
|
||||
.route("/list_jobs", post(jobs_handler))
|
||||
.route("/list_notifications", post(list_notifications_handler))
|
||||
.route("/notification_count", post(notification_count_handler))
|
||||
.route("/clear_notifications", post(clear_notifications_handler))
|
||||
.layer(
|
||||
CorsLayer::new()
|
||||
.allow_origin(cors::Any)
|
||||
@@ -146,6 +149,20 @@ async fn seeded_not_replicated_handler(State(ctx): State<Context>) -> impl IntoR
|
||||
Ok::<_, Error>(Json(rids))
|
||||
}
|
||||
|
||||
async fn list_notifications_handler() -> impl IntoResponse {
|
||||
Ok::<_, Error>(Json(Vec::<
|
||||
radicle_types::domain::inbox::models::notification::NotificationsByRepo,
|
||||
>::new()))
|
||||
}
|
||||
|
||||
async fn notification_count_handler() -> impl IntoResponse {
|
||||
Ok::<_, Error>(Json(0_usize))
|
||||
}
|
||||
|
||||
async fn clear_notifications_handler() -> impl IntoResponse {
|
||||
Ok::<_, Error>(Json(()))
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct RepoBody {
|
||||
pub rid: identity::RepoId,
|
||||
|
||||
Reference in New Issue
Block a user