Rank 2: Process
Hi there,
while tesing I am creating a team and assign a user as owner. I set up the team in the beginning and delete it after the test is finished. After running the test once I cannot create a team with the same id as before nor can I delete or find the team.
The following code creates this output:
total teams: 0
AppwriteException: team_already_exists, Team with requested ID already exists. Please choose a different ID and try again. (409)
Team id: eventId
AppwriteException: team_not_found, Team with the requested ID could not be found. (404)
The code creating the above output:
TeamList teamsList = await teams.list();
print('total teams: ${teamsList.total}');
// Create the team of the event
try {
await teams.create(teamId: eventId, name: eventId);
} catch (e) {
print(e.toString());
print("Team id: $eventId");
}
// Add the owner to the team as owner
await teams.createMembership(
teamId: eventId,
userId: ownerId,
roles: ['owner', 'guest'],
url: 'https://cloud.appwrite.io',
);
Has anyone an idea why this is happening?