Function is not getting executed on button click
Current Code:
Verify that id
actually has the right value
Like so
const deleteUser = (id) => {
console.log(id);
if(id === undefined){
return;
}
const promise = functions.createExecution('646b801508edd4a42aba', id);
promise.then(
function (response) {
setUserDetails(response);
console.log(response);
router.push('/');
},
function (error) {
console.log(error);
// window.location.reload();
}
);
};
Here comes the error now
Good,
Just add permission for any User
to execute the function
It worked
Thanks
Need another help on the same page
For this specific part:
const getCount = async (collection_id) => {
const list = await databases.listDocuments("646605464de2f5cb7435", collection_id);
const stats = `total is: ${list.total}`;
return stats;
}
Full code is above
What's the problem?
It was showing undefined
Actually the thing is the document is not getting created
For which it might be such thing
So this one works for you?
delete user is working
Document is also getting created
I'm now trying to get the total no of items in the collections of todolist
<div className='text-gray-500'>
<p>No of Todo items: {getCount("6466055dd831efd150ef")}</p>
</div>
Okay, but getCount is async function And you want it to return into the components? I think for that you'll need to use other field in your state use it inside your HTML and update it in the getCount function
yes
like a new useState?
Yes
[SOLVED] unable to delete user
Recommended threads
- [SOLVED] OAuth With Google & Flutter
Hi all, I'm trying to sign in with google and it all goes swimmingly until the call back. I get a new user created on the appwrite dashboard however the flutte...
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...
- My organization's project is blocked
My organization's project is blocked so unblocked my organization then I will this