kingpeppe
04/12/2022, 9:22 AMjs
export const updateEthBalance = async (ethAddress, ethBalance) => {
const { data, error } = await supabase.from('users').select().eq('ethAddress', ethAddress).update({ ethBalance: ethBalance })
console.log(data);
};
Am I doing it wrong?Needle
04/12/2022, 9:22 AM/title
command!
We have solved your problem?
Click the button below to archive it.kingpeppe
04/12/2022, 9:28 AMjs
const { data, error } = await supabase.from('users').select().match('ethAddress', ethAddress)
but i can't get update to workkingpeppe
04/12/2022, 9:42 AMjs
const { data, error } = await supabase.from('users').select().match({ ethAddress: ethAddress }).update({ ethBalance: ethBalance });
This one looks like it should work, but it doesn'ttourdownunder
04/12/2022, 10:00 AMjs
const { data, error } = await supabase.from('users').update({ ethBalance: ethBalance }).match({ ethAddress: ethAddress });
Needle
04/12/2022, 10:00 AMtourdownunder
04/12/2022, 10:01 AMselect()
And move the update
you had to replace where you had select()
kingpeppe
04/12/2022, 10:02 AMtourdownunder
04/12/2022, 10:03 AMkingpeppe
04/12/2022, 10:03 AMkingpeppe
04/12/2022, 10:03 AMtourdownunder
04/12/2022, 10:04 AMkingpeppe
04/12/2022, 10:04 AMkingpeppe
04/12/2022, 10:04 AM