Skip to content

Commit e0cedca

Browse files
committed
WIP 0.6.0
1 parent 392c3c2 commit e0cedca

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

dna/zomes/files/src/attach_to_hrl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub fn get_files_from_hrl(hrl: (DnaHash, EntryHash)) -> ExternResult<Vec<EntryHa
3434
std::panic::set_hook(Box::new(zome_panic_hook));
3535
let tp = hrl_path(hrl)?;
3636
/// Grab links
37-
let links = get_links(link_input(tp.path_entry_hash()?, FilesLinkTypes::Attachment, None))?;
37+
let links = get_links(LinkQuery::new(tp.path_entry_hash()?, FilesLinkTypes::Attachment.try_into_filter().unwrap()), GetStrategy::Network)?;
3838
let res = links
3939
.into_iter()
4040
.map(|link| link.target.into_entry_hash().unwrap())

dna/zomes/tagging/src/private.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ fn untag_private_entry(input: UntagInput) -> ExternResult<()> {
153153
let tag_eh = hash_entry(PrivateTag { value: input.tag })?;
154154
/// Get Tag link
155155
let link_tuples =
156-
get_typed_from_links::<PrivateTag>(link_input(input.target.clone(), TaggingLinkTypes::PrivateTags, None))?;
156+
get_typed_from_links::<PrivateTag>(link_input(input.target.clone(), TaggingLinkTypes::PrivateTags.try_into_filter().unwrap(), None))?;
157157
let link_tuple: Vec<(PrivateTag, Link)> = link_tuples
158158
.into_iter()
159159
.filter(|(tag_entry, _link)| {
@@ -167,10 +167,10 @@ fn untag_private_entry(input: UntagInput) -> ExternResult<()> {
167167
let link = link_tuple[0].1.clone();
168168

169169
/// Delete Entry -> Tag Link
170-
let _ = delete_link(link.create_link_hash)?;
170+
let _ = delete_link(link.create_link_hash, GetOptions::default())?;
171171
/// Get reverse link
172172
let tag_eh = hash_entry(link_tuple[0].0.clone())?;
173-
let links = get_links(link_input(tag_eh, TaggingLinkTypes::PrivateEntry, None))?;
173+
let links = get_links(link_input(tag_eh, TaggingLinkTypes::PrivateEntry.try_into_filter().unwrap(), None), GetStrategy::Network)?;
174174
let link: Vec<Link> = links
175175
.into_iter()
176176
.filter(|link| link.target.clone().into_entry_hash() == Some(input.target.clone()))
@@ -179,7 +179,7 @@ fn untag_private_entry(input: UntagInput) -> ExternResult<()> {
179179
return error("No reverse link found for private entry tag");
180180
}
181181
/// Delete Tag Link -> Entry
182-
let _ = delete_link(link[0].clone().create_link_hash)?;
182+
let _ = delete_link(link[0].clone().create_link_hash, GetOptions::default())?;
183183
/// Done
184184
Ok(())
185185
}
@@ -191,7 +191,7 @@ pub fn find_private_tags_for_entry(eh: EntryHash) -> ExternResult<Vec<(EntryHash
191191
/// Make sure entry exist and is private
192192
let _record = query_private_entry(eh.clone())?;
193193
/// Grab private tags
194-
let link_tuples = get_typed_from_links::<PrivateTag>(link_input(eh, TaggingLinkTypes::PrivateTags, None))?;
194+
let link_tuples = get_typed_from_links::<PrivateTag>(LinkQuery::new(eh, TaggingLinkTypes::PrivateTags.try_into_filter().unwrap()))?;
195195
let res = link_tuples
196196
.clone()
197197
.into_iter()
@@ -213,7 +213,7 @@ pub fn find_private_entries_with_tag(tag: String) -> ExternResult<Vec<(EntryHash
213213
for tuple in private_tags {
214214
if tuple.2 == tag {
215215
/// Found: grab links
216-
let links = get_links(link_input(tuple.0, TaggingLinkTypes::PrivateEntry, None))?;
216+
let links = get_links(link_input(tuple.0, TaggingLinkTypes::PrivateEntry.try_into_filter().unwrap(), None), GetStrategy::Network)?;
217217
let res = links
218218
.clone()
219219
.into_iter()

dna/zomes/tagging/src/public.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub fn find_public_tags_for_entry(eh: EntryHash) -> ExternResult<Vec<String>> {
120120
/// Make sure entry exist and is public
121121
let _ = fetch_public_entry(eh.clone())?;
122122
/// Grab public tags
123-
let link_details = get_link_details(eh, TaggingLinkTypes::PublicTags, None, GetOptions::network())?;
123+
let link_details = get_links_details(LinkQuery::new(eh, TaggingLinkTypes::PublicTags.try_into_filter().unwrap()), GetStrategy::Network)?;
124124
let create_links: Vec<Link> = link_details
125125
.into_inner()
126126
.into_iter()
@@ -151,11 +151,11 @@ pub fn find_public_entries_with_tag(tag: String) -> ExternResult<Vec<(ActionHash
151151
let mut tp = root_path()?;
152152
tp.path.append_component(tag.clone().into());
153153
/// Grab entries
154-
let link_details = get_link_details(
154+
let link_details = get_links_details(LinkQuery::new(
155155
tp.path_entry_hash()?,
156-
TaggingLinkTypes::PublicEntry,
157-
None,
158-
GetOptions::network(),
156+
TaggingLinkTypes::PublicEntry.try_into_filter().unwrap(),
157+
),
158+
GetStrategy::Network,
159159
)?;
160160
let mut create_links = Vec::new();
161161
let mut delete_links = Vec::new();
@@ -247,9 +247,9 @@ fn untag_public_entry(link_ah: ActionHash) -> ExternResult<ActionHash> {
247247
/// Grab reverse link
248248
let links = get_links(link_input(
249249
create_link.target_address.clone(),
250-
TaggingLinkTypes::PublicTags,
250+
TaggingLinkTypes::PublicTags.try_into_filter().unwrap(),
251251
None,
252-
))?;
252+
), GetStrategy::Network)?;
253253
let mut maybe_reverse_link_ah = None;
254254
debug!(
255255
"untag_public_entry() reverse links: {:?} | target: {}",

0 commit comments

Comments
 (0)