export const createMemberShip=async(teamId,role,email,userId)=>{
try{
const promise = await teams.createMembership(teamId,[role],'', email, userId);
return(promise)
}
catch(err){
console.log(err)
return(null)
}
}
Causes : AppwriteException: Invalid email param: Value must be a valid email address
well... is the email you're passing through valid?
Yes sir
Looks like you might be off a bit, it looks to me, from the documentation, that the 3rd item in the createMembership function should be the email. You have ''
Oh let me check
Here's the type, so you know what should go where.
createMembership(teamId: string, roles: string[], email?: string | undefined, userId?: string | undefined, phone?: string | undefined, url?: string | undefined, name?: string | undefined)
AppwriteException: URL is required
So ig when the email is passed instead of user id it requires url?
It says url is required no matter what i pass.
https://appwrite.io/docs/references/cloud/client-web/teams#createMembership
Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist.
So to me this reads as though the URL is required so it knows where to redirect someone. I see it says it's not a required property but it reads as though it is.
yeh
i gave localhost as the url and it worked
thanks a lot sir
Sorry for the confusion! Glad you got it working
[SOLVED] Issue while creating team membership
but here it says N/A
@Kenny
Recommended threads
- 403 The current user has been blocked.
Hello, I have a free plan; I've tried to access my project and I get the message "403 The current user has been blocked." I have database, sites, and auth in us...
- [Bug?] row_already_exists (409) after ma...
Hi, I'm experiencing a confusing issue with Appwrite Cloud Setup: A `tournaments` table with a composite UNIQUE index on (tournament_name, date). Steps to rep...
- Am getting "The current user has been bl...
Was working on my app FLUTTER WEB APP, and suddenly, I have been blocked.... What can I do ? When I try to sign in to the console, I get "The current user has ...