Skip to content

Commit

Permalink
Merge pull request holochain#137 from emhoracek/update-vue-scaffold
Browse files Browse the repository at this point in the history
Update vue scaffolding
  • Loading branch information
ThetaSinner authored and c12i committed Jan 11, 2024
1 parent 47d47eb commit 5275bd0
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
</div>

<div v-else style="display: flex; flex-direction: column">
<span v-if="error">Error fetching the {{lower_case (plural ../entry_type.name)}}: {{{{raw}}}} {{error}}.{{{{/raw}}}}</span>
<div v-else-if="links && links.length > 0" style="margin-bottom: 8px">
<span v-if="error">Error fetching the {{lower_case (plural ../entry_type.name)}}: {{{{raw}}}} {{error.data}}.{{{{/raw}}}}</span>
<div v-else-if="hashes && hashes.length > 0" style="margin-bottom: 8px">
<{{pascal_case ../entry_type.name}}Detail
v-for="link in links"
:{{kebab_case ../entry_type.name}}-hash="link.target"
Expand All @@ -20,7 +20,7 @@
<script lang="ts">
import { defineComponent, inject, ComputedRef } from 'vue';
import { decode } from '@msgpack/msgpack';
import { AppAgentClient, Record, Link, AgentPubKey } from '@holochain/client';
import { AppAgentClient, Record, AgentPubKey, EntryHash, ActionHash, CallZomeResponse } from '@holochain/client';
import '@material/mwc-circular-progress';
import {{pascal_case ../entry_type.name}}Detail from './{{pascal_case ../entry_type.name}}Detail.vue';
Expand All @@ -47,13 +47,14 @@ export default defineComponent({
}
try {
this.links = await this.client.callZome({
const records = await this.client.callZome({
cap_secret: null,
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: this.{{camel_case linked_from.singular_arg}},
});
this.hashes = records.map((r: CallZomeResponse) => r.signed_action.hashed.hash);
} catch (e) {
this.error = e;
}
Expand Down

0 comments on commit 5275bd0

Please sign in to comment.