1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

JSON output -> dynamic output

This commit is contained in:
Eldad Fux 2020-06-23 21:53:48 +03:00
parent e469cccb61
commit 33e9c486c8
3 changed files with 1 additions and 53 deletions

View file

@ -225,7 +225,7 @@ $utopia->post('/v1/account/sessions')
->setStatusCode(Response::STATUS_CODE_CREATED)
;
$response->json($session->getArrayCopy());
$response->dynamic($session, Response::MODEL_SESSION);
}
);

View file

@ -115,25 +115,6 @@ $utopia->get('/v1/database/collections')
->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true)
->action(
function ($search, $limit, $offset, $orderType) use ($response, $projectDB) {
/*$vl = new Structure($projectDB);
var_dump($vl->isValid(new Document([
'$collection' => Database::SYSTEM_COLLECTION_RULES,
'$permissions' => [
'read' => ['*'],
'write' => ['*'],
],
'label' => 'Platforms',
'key' => 'platforms',
'type' => 'document',
'default' => [],
'required' => false,
'array' => true,
'options' => [Database::SYSTEM_COLLECTION_PLATFORMS],
])));
var_dump($vl->getDescription());*/
$results = $projectDB->getCollection([
'limit' => $limit,
'offset' => $offset,

View file

@ -1,33 +0,0 @@
<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Health extends Model
{
public function __construct()
{
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'User';
}
/**
* Get Collection
*
* @return string
*/
public function getType():string
{
return Response::MODEL_LOCALE;
}
}