feat: add global_repositories query

This commit is contained in:
2026-01-20 16:17:53 -08:00
parent 43c9b7c238
commit 5eccfe32da
9 changed files with 481 additions and 8 deletions

View File

@@ -76,8 +76,15 @@ impl UserRepository {
.await?
.items()
.iter()
.filter_map(|item| Some(item.get("full_name")?.as_s().ok()?.to_string()))
.filter_map(|item| {
if (*item.get("approved")?.as_bool().ok()?) == false {
return None;
};
Some(item.get("full_name")?.as_s().ok()?.to_string())
})
.collect::<Vec<String>>();
Ok(HttpResponse::Ok().json(response))
}
pub async fn add_repository(
@@ -97,6 +104,7 @@ impl UserRepository {
.item("gsi1pk", AttributeValue::S("REPOS".into()))
.item("gsi1sk", AttributeValue::S(now.clone()))
.item("imported_at", AttributeValue::S(now))
.item("approved", AttributeValue::Bool(false))
.send()
.await;