Dapp Assignment 1

Post your solutions to the remove dog assignment here.

I first checked how it works from the terminal and checked the cpp contract.
cleos push action dogcontract erase ‘[4]’ -p medosync

executed transaction: 6bcf1968898b9f8f428a56a8a99de3a39b679b6a11af957cba1883688edf3f02 96 bytes 257 us
'# dogcontract <= dogcontract::erase {“dog_id”:4}
warning: transaction executed locally, but may not be confirmed by the network yet ]

<div class="row">
    <div class="col">
      <h2>Remove Dog</h2>
        <label>Dog Number:</label>
        <input type="number" id="dog_id">
      <button type="button" id="remove_dog_button" class="bth btn-secondary">Remove Dog</button>

function removeDog(){

var dogNumber = $("#dog_id").val();
actions: [{
account: contractConfig.code,
name: ‘erase’,
authorization: [{
actor: account.name,
permission: account.authority
data: {
dog_id: dogNumber
}, {
blocksBehind: 3,
expireSeconds: 30
//Transaction successful Add Dog

1 Like