Add notification endpoint stubs to test-http-api

This commit is contained in:
Rūdolfs Ošiņš
2026-03-20 14:07:42 -06:00
parent e06a371447
commit 656ddd172c
+17
View File
@@ -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,