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
- Migration and Function glitch
I am trying to migrate from non pro appwrite project to pro appwrite project all my data but it's stuck in processing.
- Unable to signup to appwrite cloud
When attempting to create an online cloud account on appwrite.io, I get the following message : "This email address must already be in its canonical form. Pleas...
- Email address must be in its canonical f...
Hello, Recently I was trying to signup with my GitHub account with appwrite account for availing the student benifits but while trying to signup I saw such erro...