JSON output -> dynamic output
This commit is contained in:
parent
e469cccb61
commit
33e9c486c8
3 changed files with 1 additions and 53 deletions
|
@ -225,7 +225,7 @@ $utopia->post('/v1/account/sessions')
|
||||||
->setStatusCode(Response::STATUS_CODE_CREATED)
|
->setStatusCode(Response::STATUS_CODE_CREATED)
|
||||||
;
|
;
|
||||||
|
|
||||||
$response->json($session->getArrayCopy());
|
$response->dynamic($session, Response::MODEL_SESSION);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -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)
|
->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true)
|
||||||
->action(
|
->action(
|
||||||
function ($search, $limit, $offset, $orderType) use ($response, $projectDB) {
|
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([
|
$results = $projectDB->getCollection([
|
||||||
'limit' => $limit,
|
'limit' => $limit,
|
||||||
'offset' => $offset,
|
'offset' => $offset,
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue