Hello sir, part of the issue is that you have to point the correct dog owner.
Probably the error is in:
dogs.modify(iterator, account owner, [&](auto& row) {...
Instead “account owner”, it should point to “dog.owner”, why?
Simple, you have to point into the TABLE that you call dog, so if you point it to “dog.owner” it will look at all the dogs that is owned that the account owner in the dog table.
If your table looks like this one, then you should use dog.owner to correctly point to look at the owner of the dogs in that table.
//table struct dog
TABLE dog{
int id; //unique ID for index
std::string dog_name;
int age;
name owner; //eos account name, owner of dogs
//get primary key by ID variable
uint64_t primary_key() const{return id;}
//get dogs by owner index
uint64_t by_owner() const{return owner.value;}
};
Then you use the same action, but correct the little pointer, it should be like this:
dogs.modify(iterator, dog.owner, [&](auto& row) {
row.dog_name = new_dog_name;
row.age = new_age;
};
If i explain myself kinda confusing, let me know so i can try to explain myself better.
Hope this gives you a clear view of the subject, keep learning!
Carlos Z.