BUG: teams.listMemberships returns 404 when team exists but using query to filter users
- 0
- Teams
- Flutter
- Cloud
using sdk for Flutter. my code:
Future<models.Membership?> getMembership(String teamId, String userId) async {
try {
final models.MembershipList list = await teams.listMemberships(
teamId: teamId,
queries: [
Query.equal('userId', userId)
]
);
return list.total > 0 ? list.memberships[0] : null;
} catch (e) {
print("ERROR getMembership: $e");
return null;
}
}
expected: 200 OK with MembershipList.total = 0 actual: AppwriteException: team_not_found, Team with the requested ID could not be found. (404). server version: Cloud (1.1.2). SDK Flutter 8.1.0 <#1102936099745177700>
according to the source (master branch) probably was resolved later 1.1.2. could anyone confirm this?
make sure to use 3 backticks when formatting multiline code
what happens if you run teams.list()?
Returns $.total=0 if the user not belongs to the group (great). But I need to return the membership to validate the roles
So if they aren't in the team, it'll return 404. That's expected
I agree to be disagree. The name of the endpoint is membership, no team. Membership is a sub resource of team. So the right answer should be total=0 because is returning a list of memberships
Like team.list return total=0 too
Yes, because the user isn't in any teams
The API lists the memberships of a team, but the team doesn't exist
Recommended threads
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...
- Create a new paid tier
Current pricing seems reasonable enough about what is someone getting for 25$. But for some people most of these resouces are getting wasted. Like the bandwidt...
- [Bug] Appwrite Auth User Prefs
User prefs are decoded as blank although there are plenty of data and add preference button not working in this case