Rank 1: Thread
I want to set the labels at the time user signup to my application , all things work , users data save in auth, updateprefs set , a verification email sent , but unable to set labels bcz in appwrite Account service their is no method for updateLabels, any one can help me using appwrite Function how can i acheive it
Signup.jsx(some code where i do the usercreation )
const create = async (data) => {
setError("");
try {
await authService.createAccount(data);
await authService.updatePrefs({ role: data.role });
const updatedUser = await authService.getCurrentUser();
const mergedUser = updatedUser? { ...updatedUser, prefs: { ...(updatedUser.prefs || {}), role: data.role }, }: null;
if (mergedUser) dispatch(login({ userData: mergedUser }));
authService.sendVerification();
} catch (error) {
if (error.code === 400) {
setError("Password must be at least 8 characters long.");
} else {
setError("Email already exists.");
}
}
};