Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/How to FetchByKey from React?Forum ↗

How to FetchByKey from React?

App Development2 posts466 views1 likesLast activity Mar 2021
MA
ManishGroverOP
Mar 2021

Hi,

Please help with the right way to fetch this contract by its key.

template MyTemplate
  with 
    party1: Party
    productId: Text
    comment: Text 
  where 
    signatory party1
    key (party1, productId):(Party, Text)
    maintainer key._1

Many thanks. @palanisamyc @alex.graham

MA
ManishGrover
Mar 2021

This works. Thank you @alex.graham

const key = { _1: "MyParty", _2: "MyString" };
const {contract, loading} = useFetchByKey(MyTemplate, () => key, []);
← Back to Discussions