|
1 | 1 | pub use hdk::prelude::*; |
2 | | -use hc_utils::*; |
| 2 | +use hc_utils::get_links_and_load_type; |
3 | 3 | use std::collections::BTreeMap; |
4 | 4 | use holo_hash::EntryHashB64; |
5 | 5 |
|
@@ -36,7 +36,7 @@ fn create_space(input: Space) -> ExternResult<EntryHashB64> { |
36 | 36 | let space_eh = hash_entry(input.clone())?; |
37 | 37 | let path = get_spaces_path(); |
38 | 38 | path.ensure()?; |
39 | | - let anchor_hash = path.hash()?; |
| 39 | + let anchor_hash = path.path_entry_hash()?; |
40 | 40 | create_link(anchor_hash, space_eh.clone(), ())?; |
41 | 41 | let eh64: EntryHashB64 = space_eh.clone().into(); |
42 | 42 | // let me = agent_info()?.agent_latest_pubkey.into(); |
@@ -78,7 +78,7 @@ fn create_space_with_sessions(input: SpaceSessionsInput) -> ExternResult<EntryHa |
78 | 78 |
|
79 | 79 | /// Returns 0 if no session found or if space does not exist |
80 | 80 | pub fn get_next_session_index(space_eh: EntryHash) -> WhereResult<u32> { |
81 | | - let sessions: Vec<PlacementSession> = get_links_and_load_type(space_eh, None)?; |
| 81 | + let sessions: Vec<PlacementSession> = get_links_and_load_type(space_eh, None, false)?; |
82 | 82 | let mut top = 0; |
83 | 83 | for session in sessions { |
84 | 84 | if session.index >= top { |
@@ -157,13 +157,13 @@ fn get_visible_spaces(_: ()) -> ExternResult<Vec<SpaceOutput>> { |
157 | 157 | #[hdk_extern] |
158 | 158 | fn get_spaces(_: ()) -> ExternResult<Vec<SpaceOutput>> { |
159 | 159 | let path = get_spaces_path(); |
160 | | - let anchor_hash = path.hash()?; |
| 160 | + let anchor_hash = path.path_entry_hash()?; |
161 | 161 | let spaces = get_spaces_inner(anchor_hash)?; |
162 | 162 | Ok(spaces) |
163 | 163 | } |
164 | 164 |
|
165 | 165 | fn get_spaces_inner(base: EntryHash) -> WhereResult<Vec<SpaceOutput>> { |
166 | | - let entries = get_links_and_load_type(base, None)?; |
| 166 | + let entries = get_links_and_load_type(base, None, false)?; |
167 | 167 | let mut spaces = vec![]; |
168 | 168 | for e in entries { |
169 | 169 | spaces.push(SpaceOutput {hash: hash_entry(&e)?.into(), content: e}); |
|
0 commit comments