Radish alpha
r
rad:z4D5UCArafTzTQpDZNQRuqswh3ury
Radicle desktop app
Radicle
Git
Add notification endpoint stubs to test-http-api
Rūdolfs Ošiņš committed 1 month ago
commit 656ddd172c7daa9a7c409939caf6a4143afcf81e
parent e06a371
1 file changed +17 -0
modified crates/test-http-api/src/api.rs
@@ -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,