Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm

fixes at-microcosm/links#24 for constellation /links/distinct-dids total is not distinct total

Changed files
+12 -2
constellation
src
server
+12 -2
constellation/src/server/mod.rs
···
.get_links(&query.target, &query.collection, &query.path, limit, until)
.map_err(|_| http::StatusCode::INTERNAL_SERVER_ERROR)?;
+
let total = store
+
.get_count(&query.target, &query.collection, &query.path)
+
.map_err(|_| http::StatusCode::INTERNAL_SERVER_ERROR)?;
+
let cursor = paged.next.map(|next| {
ApiCursor {
version: paged.version,
···
Ok(acceptable(
accept,
GetLinkItemsResponse {
-
total: paged.version.0,
+
total: total,
linking_records: paged.items,
cursor,
query: (*query).clone(),
···
.get_distinct_dids(&query.target, &query.collection, &query.path, limit, until)
.map_err(|_| http::StatusCode::INTERNAL_SERVER_ERROR)?;
+
let distinct_dids_total = store
+
.get_distinct_did_count(&query.target, &query.collection, &query.path)
+
.map_err(|_| http::StatusCode::INTERNAL_SERVER_ERROR)?;
+
+
+
let cursor = paged.next.map(|next| {
ApiCursor {
version: paged.version,
···
Ok(acceptable(
accept,
GetDidItemsResponse {
-
total: paged.version.0,
+
total: distinct_dids_total,
linking_dids: paged.items,
cursor,
query: (*query).clone(),