feat: add global_repositories query
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user