hi guys, i'm a junior dev building my first app on react navide with appwrite cloud, i'm trying to build the function so users could delete their account, data and user but i'm gettin the same error all the time account.delete is not a function, i saw some changes on appwrite about delete account but just cant understand right how to do(function on appwrite console?) so if anyone could help me with that i'll appreciate a lot! there's my code now: export const deleteAccountAndData = async () => { try { const currentAccount = await account.get(); const userId = currentAccount.$id; console.log('cuenta obtenida')
const userDocument = await databases.listDocuments(databaseId, userCollectionId, [Query.equal('accountId', userId)]); if (userDocument.documents.length > 0) { await databases.deleteDocument(databaseId, userCollectionId, userDocument.documents[0].$id); console.log('documento usuario eliminado') }
await account.delete(userId);
console.log('cuenta eliminada')
} catch (error) {
console.error("Error eliminando la cuenta y datos del usuario:", error);
throw new Error(error.message);
}
};
Account can be deleted by a server side application or you can use cloud function
Recommended threads
- SELF HOSTING ISSUE, DATA NOT MIGRATING T...
Hey, devs, I recently tried to migrate my cloud instance to a self hosted version but my data is not transferred fully only the table structure is transferred ...
- Auth working for emulator but not for ph...
hey guys i'm using appwrite for expo react native it is working perfectly for emulator but does not working for physical devices can u explain any one and it is...
- unlike any other provider, your sites DN...
your nameservers dont work with a funny little CNAME error, which is a weird bug but thats what you get when you try to be the kitchen sink, funny errors.