Trying to user teams.createMembership (appwrite.js), I am trying to send an invite to my gmail but it is failing stating the email is invalid
AppwriteException: Invalid email: Value must be a valid email address
[Error] Method: POST
[Error] URL: /v1/teams/:teamId/memberships
[Error] Type: Utopia\Exception
[Error] Message: Invalid email: Value must be a valid email address
[Error] File: /usr/src/code/vendor/utopia-php/framework/src/App.php
[Error] Line: 742```
My Code:
```.teams.createMembership('client', 'ezekielj221@gmail.com', roles, `${Server.baseURL}/invite/${companyId}?tkn=${authToken}`)```
the email is 100% a valid email, any insight on this?
- what sdk?
- what sdk version?
- what appwrite version?
appwrite.js "appwrite": "^11.0.0", 1.4.0
look at the function signature: https://github.com/appwrite/sdk-for-web/blob/7b37a2bec1dbe47b55e2c962996046f56b763192/src/services/teams.ts#L233
okay, order is different than what is in the docs https://appwrite.io/docs/client/teams?sdk=web-default&v=cloud#teamsCreateMembership
that helps, thank you!
@Steven new issue, It is telling me the team id does not exist:
AppwriteException: Team with the requested ID could not be found.
POST https://[REDACTED]/v1/teams/client/memberships 404
is the user in the team? is the user an owner in the team? Probably not considering that members count is 0 👀
derp. thanks
Okay, I am in the team now, how to i give myself permissions to send invitations?
The member needs to have role owner
ugh, i set it to "Owner" with a capital O.
as always. thanks for your help Steven
Recommended threads
- Hosted a webite on appwrite 2 days ago, ...
I dont really know why its down, everything looks fine, the deployments and all
- OAuth login not working on deployed app ...
Hey there, I've been dealing with an issue where I cannot use OAuth on my deployed app - locally everything works fine. I am using react-router in Framework Mo...
- database documents relationships
after migrating from 1.7.4 to 1.8, database get document and list documents is getting results but with no relationship values, the relationship attribute will...