TypeScript
const { users, databases } = await createAdminClient();
const session = await getLoggedInUser();
const user = await users.get(session.$id);
if (!user) {
throw new Error("User not found");
}
await users.updateEmail(user.$id, email);
await users.updateName(user.$id, first_name + " " + last_name);
if (phone) {
await users.updatePhone(user.$id, phone);
}
it throwing ⨯ AppwriteException: A target with the same ID already exists.
at async updateProfile (account/action.ts:32:9)
TL;DR
Error message "A target with the same ID already exists" is thrown when updating user information due to a conflict.
Possible solution: Check for duplicate IDs in the update process to prevent errors.Recommended threads
- One-time Cloud migration blocked by data...
Hi, I’m blocked on a one-time migration from Appwrite Cloud to my self-hosted Appwrite instance. We already fixed the region issue, and the migration now corre...
- All My Project is Gone
Hello everyone, please help. Why have all my projects suddenly disappeared? I received a warning via email about one of my projects being paused. When I clicked...
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...