mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Merge pull request #10182 from appwrite/bump-response-format
Bump response format, Fix backwards compat
This commit is contained in:
commit
8898d4c55b
2 changed files with 7 additions and 4 deletions
|
|
@ -271,7 +271,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|||
->setTwitter(APP_SOCIAL_TWITTER_HANDLE)
|
||||
->setDiscord(APP_SOCIAL_DISCORD_CHANNEL, APP_SOCIAL_DISCORD)
|
||||
->setDefaultHeaders([
|
||||
'X-Appwrite-Response-Format' => '1.7.0',
|
||||
'X-Appwrite-Response-Format' => '1.8.0',
|
||||
])
|
||||
->setExclude($language['exclude'] ?? []);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class V20 extends Filter
|
|||
switch ($model) {
|
||||
case 'databases.getDocument':
|
||||
case 'databases.listDocuments':
|
||||
$content = $this->manageSelectQueries($content, $model);
|
||||
$content = $this->manageSelectQueries($content);
|
||||
break;
|
||||
}
|
||||
return $content;
|
||||
|
|
@ -30,7 +30,7 @@ class V20 extends Filter
|
|||
* This filter preserves 1.7.x behavior by including all related documents for backward compatibility with
|
||||
* `listDocuments` and `getDocument` calls.
|
||||
*/
|
||||
protected function manageSelectQueries(array $content, string $model): array
|
||||
protected function manageSelectQueries(array $content): array
|
||||
{
|
||||
$hasWildcard = false;
|
||||
if (! isset($content['queries'])) {
|
||||
|
|
@ -58,7 +58,10 @@ class V20 extends Filter
|
|||
}
|
||||
}
|
||||
|
||||
if ($hasWildcard && $model === 'databases.listDocuments') {
|
||||
/**
|
||||
* Add `keys.*` for all model types!
|
||||
*/
|
||||
if ($hasWildcard) {
|
||||
$relatedKeys = $this->getRelatedCollectionKeys();
|
||||
|
||||
if (! empty($relatedKeys)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue