Could anybody help me with this?
This is my component (written by not me but a React developer), with the function call:
const ButtonLA4 = (props) => {
const { children } = props;
let date = new Date()
let newId = Date.now()
const ledger = useLedger();
const buttonLa4Function = async () =>{
try {
await ledger.exerciseByKey(
Main.Setup.Setup_MegrendelestIndit, "ledger-party-beszerzes",
{
eszkozMegnevezes: "Eszkoz-abcd",
megrendelo: "ledger-party-megrendelo",
megrendeloAdatok: { megrendeloNev: "Megrendelonev-abcd", megrendeloCusman: "MegrendeloCusman-1234" },
kosarszam: "Kosarszam-1234"
}
);
} catch (err) {
alert(`Error of exerciseByKey with choice = Main.Setup.Setup_MegrendelestIndit:\n${err}`);
}
}
return (
<a href="javascript:SubmitForm('form2')" onClick={buttonLa4Function}>
<div className="beszer-button-la beszer-border-1px-thunder">
<div className="beszer-lorem-ipsum-i115131 beszer-opensans-normal-white-14px">{children}</div>
</div>
</a>
);
}
I get the following errors:
POST http://localhost:3000/v1/exercise 404 (Not Found)
Cannot POST /v1/exercise
The acting party (the party on behalf of which I issue the command) is allocated on the ledger, and is specified with party id and access token in the DamlLedger component of the React code.
The acting party can see the contract Main.Setup
in Navigator, and the contract has the choice Setup_MegrendelestIndit
.
The contract has the key I specify in the call:
-- SETUP START
template Setup
with
kancellaria : Party
beszerzes : Party
penzugy : Party
helpdesk : Party
szallito : Party
where
signatory kancellaria
key kancellaria : Party
maintainer key
-- A Zebra beszerzĂ©s partykĂ©nt rögzĂti a megrendelĂ©st
controller beszerzes can
nonconsuming Setup_MegrendelestIndit : ContractId Megrendeles
with
eszkozMegnevezes : Text
megrendelo : Party
megrendeloAdatok : MegrendeloAdatok
kosarszam : Text
do
megrendelesIdopontja <- getTime
let
folyamatAzonosito = sha256 $ show eszkozMegnevezes <> show megrendelesIdopontja
folyamatAdatok = FolyamatAdatok with
folyamatAzonosito
eszkozMegnevezes
gyariszam = None
szamlaSzama = None
..
megrendelesiAdatok = MegrendelesiAdatok with
megrendelesIdopontja
kosarszam
..
create Megrendeles
with
..
-- SETUP END
I guess I don’t notice something trivial, can you help me to find it?