Arrow
I am using the dart sdk client to create team memberships. However, the membershipId parameter is nowhere to be found.
self-hosted appwrite 1.4.12 dart client: dart_appwrite: ^10.1.1
This is the source api code
TypeScript
Future<models.Membership> createMembership(
{required String teamId,
required List<String> roles,
String? email,
String? userId,
String? phone,
String? url,
String? name}) async {
final String apiPath =
'/teams/{teamId}/memberships'.replaceAll('{teamId}', teamId);
final Map<String, dynamic> apiParams = {
'email': email,
'userId': userId,
'phone': phone,
'roles': roles,
'url': url,
'name': name,
};
final Map<String, String> apiHeaders = {
'content-type': 'application/json',
};
final res = await client.call(HttpMethod.post,
path: apiPath, params: apiParams, headers: apiHeaders);
return models.Membership.fromMap(res.data);
}```
TL;DR
Problem: When creating team memberships using the dart SDK client, the membershipId parameter is missing.
Solution: The membershipId parameter is typically used to uniquely identify the membership being created. In the provided API code snippet, the parameter is absent from the createMembership function. It needs to be added to the apiParams map with an appropriate value before making the API call to properly create a team membership. Recommended threads
- Upgrade Issue
Am having issue upgrading my appwrite account to pro as my card number is 19 and the required input is 16 digit
- Is there way to copy project (backup/res...
I think there is betterr way of fast back up / restore specified project
- Database setup
Hi everybody, I'm new to AppWrite and I need some help designing a database. I'm trying to set up a database where: 1. There are USERS 2. A USER can create an ...