Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public function action(string $databaseId, string $collectionId, string $documen
value: $value,
min: $min
);
$document->setAttribute('$' . $this->getCollectionsEventsContext() . 'Id', $collectionId);
} catch (ConflictException) {
throw new Exception($this->getConflictException());
} catch (NotFoundException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public function action(string $databaseId, string $collectionId, string $documen
value: $value,
max: $max
);
$document->setAttribute('$' . $this->getCollectionsEventsContext() . 'Id', $collectionId);
} catch (ConflictException) {
throw new Exception($this->getConflictException());
} catch (NotFoundException) {
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/Services/Databases/Legacy/DatabasesBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6118,6 +6118,7 @@ public function testIncrementAttribute(): void
]));
$this->assertEquals(200, $inc['headers']['status-code']);
$this->assertEquals(6, $inc['body']['count']);
$this->assertEquals($collectionId, $inc['body']['$collectionId']);

// Verify count = 6
$get = $this->client->call(Client::METHOD_GET, "/databases/$databaseId/collections/$collectionId/documents/$docId", array_merge([
Expand Down Expand Up @@ -6229,6 +6230,7 @@ public function testDecrementAttribute(): void
]));
$this->assertEquals(200, $dec['headers']['status-code']);
$this->assertEquals(9, $dec['body']['count']);
$this->assertEquals($collectionId, $dec['body']['$collectionId']);

$get = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([
'content-type' => 'application/json',
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/Services/Databases/TablesDB/DatabasesBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -7760,6 +7760,7 @@ public function testIncrementColumn(): void
'x-appwrite-project' => $this->getProject()['$id'],
]));
$this->assertEquals(200, $inc['headers']['status-code']);
$this->assertEquals($tableId, $inc['body']['$tableId']);
$this->assertEquals(6, $inc['body']['count']);

// Verify count = 6
Expand Down Expand Up @@ -7872,6 +7873,7 @@ public function testDecrementColumn(): void
]));
$this->assertEquals(200, $dec['headers']['status-code']);
$this->assertEquals(9, $dec['body']['count']);
$this->assertEquals($tableId, $dec['body']['$tableId']);

$get = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([
'content-type' => 'application/json',
Expand Down