mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
fix: add wildcards on getDocument response model as well.
This commit is contained in:
parent
59fce99ef6
commit
97c54aeaac
1 changed files with 6 additions and 3 deletions
|
|
@ -16,7 +16,7 @@ class V20 extends Filter
|
||||||
switch ($model) {
|
switch ($model) {
|
||||||
case 'databases.getDocument':
|
case 'databases.getDocument':
|
||||||
case 'databases.listDocuments':
|
case 'databases.listDocuments':
|
||||||
$content = $this->manageSelectQueries($content, $model);
|
$content = $this->manageSelectQueries($content);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $content;
|
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
|
* This filter preserves 1.7.x behavior by including all related documents for backward compatibility with
|
||||||
* `listDocuments` and `getDocument` calls.
|
* `listDocuments` and `getDocument` calls.
|
||||||
*/
|
*/
|
||||||
protected function manageSelectQueries(array $content, string $model): array
|
protected function manageSelectQueries(array $content): array
|
||||||
{
|
{
|
||||||
$hasWildcard = false;
|
$hasWildcard = false;
|
||||||
if (! isset($content['queries'])) {
|
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();
|
$relatedKeys = $this->getRelatedCollectionKeys();
|
||||||
|
|
||||||
if (! empty($relatedKeys)) {
|
if (! empty($relatedKeys)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue