diff --git a/constellation/src/server/mod.rs b/constellation/src/server/mod.rs index b04c281..18d1c78 100644 --- a/constellation/src/server/mod.rs +++ b/constellation/src/server/mod.rs @@ -292,6 +292,9 @@ struct GetManyToManyCountsQuery { /// path to the secondary link in the linking record path_to_other: String, /// filter to linking records (join of the m2m) by these DIDs + /// + /// TODO: this should be called `link_did`, deprecate + add an alias + /// TODO: should we have an `other_did` filter as well? #[serde(default)] did: Vec, /// filter to specific secondary records @@ -700,8 +703,10 @@ struct GetManyToManyItemsQuery { /// path to the secondary link in the linking record path_to_other: String, /// filter to linking records (join of the m2m) by these DIDs + /// + /// TODO: should we have an `other_did` filter as well? #[serde(default)] - did: Vec, + link_did: Vec, /// filter to specific secondary records #[serde(default)] other_subject: Vec, @@ -740,7 +745,7 @@ fn get_many_to_many( } let filter_dids: HashSet = query - .did + .link_did .iter() .map(|d| d.trim()) .filter(|d| !d.is_empty()) diff --git a/constellation/src/storage/rocks_store.rs b/constellation/src/storage/rocks_store.rs index 8b29289..469735e 100644 --- a/constellation/src/storage/rocks_store.rs +++ b/constellation/src/storage/rocks_store.rs @@ -945,7 +945,7 @@ impl LinkReader for RocksStorage { path_to_other: &str, limit: u64, after: Option, - filter_dids: &HashSet, + filter_link_dids: &HashSet, filter_to_targets: &HashSet, ) -> Result> { let collection = Collection(collection.to_string()); @@ -965,7 +965,7 @@ impl LinkReader for RocksStorage { return Ok(PagedOrderedCollection::empty()); }; - let filter_did_ids: HashMap = filter_dids + let filter_did_ids: HashMap = filter_link_dids .iter() .filter_map(|did| self.did_id_table.get_id_val(&self.db, did).transpose()) .collect::>>()? @@ -1134,7 +1134,7 @@ impl LinkReader for RocksStorage { path_to_other: &str, limit: u64, after: Option, - filter_dids: &HashSet, + filter_link_dids: &HashSet, filter_to_targets: &HashSet, ) -> Result> { // helper to resolve dids @@ -1175,7 +1175,7 @@ impl LinkReader for RocksStorage { eprintln!("cursor: {:#?}", cursor); // (__active__) did ids and filter targets - let filter_did_ids: HashMap = filter_dids + let filter_did_ids: HashMap = filter_link_dids .iter() .filter_map(|did| self.did_id_table.get_id_val(&self.db, did).transpose()) .collect::>>()? diff --git a/constellation/templates/get-many-to-many.html.j2 b/constellation/templates/get-many-to-many.html.j2 index 9b68b1b..2f090a2 100644 --- a/constellation/templates/get-many-to-many.html.j2 +++ b/constellation/templates/get-many-to-many.html.j2 @@ -6,7 +6,7 @@ {% block content %} - {% call try_it::get_many_to_many(query.subject, query.source, query.path_to_other, query.did, query.other_subject, query.limit) %} + {% call try_it::get_many_to_many(query.subject, query.source, query.path_to_other, query.link_did, query.other_subject, query.limit) %}

Many-to-many links to {{ query.subject }} @@ -36,7 +36,7 @@ - {% for did in query.did %} + {% for did in query.link_did %} {% endfor %} {% for other in query.other_subject %}