Skip to content

Commit

Permalink
Merge pull request #120 from holochain/2023-09-15-fix-linked-collecti…
Browse files Browse the repository at this point in the history
…on-templates-holochain-0.2

Fix linked collection templates (for 0.2)
  • Loading branch information
robbiecarlton authored Sep 20, 2023
2 parents f0b878c + f49002a commit 34fb08b
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { onMount, getContext } from 'svelte';
import '@material/mwc-circular-progress';
import type { AppAgentClient, Record, ActionHash, EntryHash, AgentPubKey } from '@holochain/client';
import type { AppAgentClient, Record, ActionHash, EntryHash, AgentPubKey, NewEntryAction } from '@holochain/client';
import { clientContext } from '../../contexts';
import type { {{pascal_case ../entry_type.name}} } from './types';
import {{pascal_case ../entry_type.name}}Detail from './{{pascal_case ../entry_type.name}}Detail.svelte';
Expand All @@ -23,17 +23,18 @@ onMount(async () => {
}
try {
hashes = await client.callZome({
const records = await client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
role_name: '{{../dna_role_name}}',
zome_name: '{{../coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural ../entry_type.name)}}_for_{{snake_case linked_from.name}}',
payload: {{camel_case linked_from.singular_arg}}
});
hashes = records.map(r => {{#if ../entry_type.reference_entry_hash}}(r.signed_action.hashed.content as NewEntryAction).entry_hash{{else}}r.signed_action.hashed.hash{{/if}});
} catch (e) {
error = e;
}
loading = true;
loading = false;
});
</script>
Expand Down

0 comments on commit 34fb08b

Please sign in to comment.