Skip to content

Commit

Permalink
Fixing appwrite#3583 - create team membership to return added person …
Browse files Browse the repository at this point in the history
…name and email
  • Loading branch information
iifawzi committed Jul 22, 2022
1 parent 9035db1 commit 4ade497
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/api/teams.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@
$response->dynamic(
$membership
->setAttribute('teamName', $team->getAttribute('name'))
->setAttribute('userName', $user->getAttribute('name'))
->setAttribute('userEmail', $user->getAttribute('email')),
->setAttribute('userName', $name)
->setAttribute('userEmail', $email),
Response::MODEL_MEMBERSHIP
);
});
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/Services/Teams/TeamsBaseServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public function testCreateTeamMembership($data): array
$this->assertEquals(201, $response['headers']['status-code']);
$this->assertNotEmpty($response['body']['$id']);
$this->assertNotEmpty($response['body']['userId']);
$this->assertEquals('Friend User', $response['body']['userName']);
$this->assertEquals($email, $response['body']['userEmail']);
$this->assertNotEmpty($response['body']['teamId']);
$this->assertCount(2, $response['body']['roles']);
$this->assertIsInt($response['body']['joined']);
Expand Down

0 comments on commit 4ade497

Please sign in to comment.