Merge remote-tracking branch 'origin/1.1.x' into feat-integrate-messaging
This commit is contained in:
commit
f93099cbb6
3 changed files with 21 additions and 1 deletions
|
@ -748,6 +748,13 @@ $collections = [
|
||||||
'lengths' => [128],
|
'lengths' => [128],
|
||||||
'orders' => [Database::ORDER_ASC],
|
'orders' => [Database::ORDER_ASC],
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'$id' => ID::custom('_key_team'),
|
||||||
|
'type' => Database::INDEX_KEY,
|
||||||
|
'attributes' => ['teamId'],
|
||||||
|
'lengths' => [Database::LENGTH_KEY],
|
||||||
|
'orders' => [Database::ORDER_ASC],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@ use Appwrite\Utopia\Database\Validator\Queries\Base;
|
||||||
class Projects extends Base
|
class Projects extends Base
|
||||||
{
|
{
|
||||||
public const ALLOWED_ATTRIBUTES = [
|
public const ALLOWED_ATTRIBUTES = [
|
||||||
'name'
|
'name',
|
||||||
|
'teamId'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -167,6 +167,18 @@ class ProjectsConsoleClientTest extends Scope
|
||||||
$this->assertArrayHasKey('webhooks', $response['body']);
|
$this->assertArrayHasKey('webhooks', $response['body']);
|
||||||
$this->assertArrayHasKey('keys', $response['body']);
|
$this->assertArrayHasKey('keys', $response['body']);
|
||||||
|
|
||||||
|
$response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([
|
||||||
|
'content-type' => 'application/json',
|
||||||
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
|
], $this->getHeaders()), [
|
||||||
|
'queries' => [ 'equal("teamId", "' . $team['body']['$id'] . '")' ],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertEquals(200, $response['headers']['status-code']);
|
||||||
|
$this->assertNotEmpty($response['body']);
|
||||||
|
$this->assertCount(1, $response['body']['projects']);
|
||||||
|
$this->assertEquals($team['body']['$id'], $response['body']['projects'][0]['teamId']);
|
||||||
|
|
||||||
$response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([
|
$response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([
|
||||||
'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
|
|
Loading…
Reference in a new issue