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
- Inviting members while SMTP is disabled ...
Issue: https://github.com/appwrite/console/issues/3125 PR: https://github.com/appwrite/console/pull/3126
- Appwrite Sites: ERR_TOO_MANY_REDIRECTS o...
So, my domain was working perfectly fine with Vercel. I was using cloudflare CDN (still am) but CNAME was DNS-only. I switched over to appwrite, CNAME is still ...
- Charged after Downgrade
I downgraded from the pro plan last month, but it’s still trying to charge my card this month and my account has been restricted