Apply suggestions from code review 2
This commit is contained in:
parent
d3e02db31f
commit
ba6c528617
|
@ -663,117 +663,6 @@ $collections = [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
'services' => [
|
|
||||||
'$collection' => Database::METADATA,
|
|
||||||
'$id' => 'services',
|
|
||||||
'name' => 'services',
|
|
||||||
'attributes' => [
|
|
||||||
[
|
|
||||||
'$id' => 'projectId',
|
|
||||||
'type' => Database::VAR_STRING,
|
|
||||||
'format' => '',
|
|
||||||
'size' => Database::LENGTH_KEY,
|
|
||||||
'signed' => true,
|
|
||||||
'required' => false,
|
|
||||||
'default' => null,
|
|
||||||
'array' => false,
|
|
||||||
'filters' => [],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'$id' => 'key',
|
|
||||||
'type' => Database::VAR_STRING,
|
|
||||||
'format' => '',
|
|
||||||
'size' => Database::LENGTH_KEY,
|
|
||||||
'signed' => true,
|
|
||||||
'required' => true,
|
|
||||||
'default' => null,
|
|
||||||
'array' => false,
|
|
||||||
'filters' => [],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'$id' => 'status',
|
|
||||||
'type' => Database::VAR_BOOLEAN,
|
|
||||||
'format' => '',
|
|
||||||
'size' => 0,
|
|
||||||
'signed' => true,
|
|
||||||
'required' => true,
|
|
||||||
'default' => null,
|
|
||||||
'array' => false,
|
|
||||||
'filters' => [],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'indexes' => [
|
|
||||||
[
|
|
||||||
'$id' => '_key_project',
|
|
||||||
'type' => Database::INDEX_KEY,
|
|
||||||
'attributes' => ['projectId'],
|
|
||||||
'lengths' => [Database::LENGTH_KEY],
|
|
||||||
'orders' => [Database::ORDER_ASC],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
'providers' => [
|
|
||||||
'$collection' => Database::METADATA,
|
|
||||||
'$id' => 'providers',
|
|
||||||
'name' => 'providers',
|
|
||||||
'attributes' => [
|
|
||||||
[
|
|
||||||
'$id' => 'projectId',
|
|
||||||
'type' => Database::VAR_STRING,
|
|
||||||
'format' => '',
|
|
||||||
'size' => Database::LENGTH_KEY,
|
|
||||||
'signed' => true,
|
|
||||||
'required' => false,
|
|
||||||
'default' => null,
|
|
||||||
'array' => false,
|
|
||||||
'filters' => [],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'$id' => 'key',
|
|
||||||
'type' => Database::VAR_STRING,
|
|
||||||
'format' => '',
|
|
||||||
'size' => Database::LENGTH_KEY,
|
|
||||||
'signed' => true,
|
|
||||||
'required' => true,
|
|
||||||
'default' => null,
|
|
||||||
'array' => false,
|
|
||||||
'filters' => [],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'$id' => 'appId',
|
|
||||||
'type' => Database::VAR_STRING,
|
|
||||||
'format' => '',
|
|
||||||
'size' => Database::LENGTH_KEY,
|
|
||||||
'signed' => true,
|
|
||||||
'required' => true,
|
|
||||||
'default' => null,
|
|
||||||
'array' => false,
|
|
||||||
'filters' => [],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'$id' => 'appSecret',
|
|
||||||
'type' => Database::VAR_STRING,
|
|
||||||
'format' => '',
|
|
||||||
'size' => 16384,
|
|
||||||
'signed' => true,
|
|
||||||
'required' => true,
|
|
||||||
'default' => null,
|
|
||||||
'array' => false,
|
|
||||||
'filters' => [],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'indexes' => [
|
|
||||||
[
|
|
||||||
'$id' => '_key_project',
|
|
||||||
'type' => Database::INDEX_KEY,
|
|
||||||
'attributes' => ['projectId'],
|
|
||||||
'lengths' => [Database::LENGTH_KEY],
|
|
||||||
'orders' => [Database::ORDER_ASC],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
'domains' => [
|
'domains' => [
|
||||||
'$collection' => Database::METADATA,
|
'$collection' => Database::METADATA,
|
||||||
'$id' => 'domains',
|
'$id' => 'domains',
|
||||||
|
|
|
@ -470,7 +470,7 @@ App::patch('/v1/projects/:projectId/service')
|
||||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||||
->param('service', '', new WhiteList(array_keys(array_filter(Config::getParam('services'), function($element) {return $element['optional'];})), true), 'Service name.')
|
->param('service', '', new WhiteList(array_keys(array_filter(Config::getParam('services'), function($element) {return $element['optional'];})), true), 'Service name.')
|
||||||
->param('status', true, new Boolean(), 'Service status.')
|
->param('status', null, new Boolean(), 'Service status.')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->inject('dbForConsole')
|
->inject('dbForConsole')
|
||||||
->action(function ($projectId, $service, $status, $response, $dbForConsole) {
|
->action(function ($projectId, $service, $status, $response, $dbForConsole) {
|
||||||
|
|
Loading…
Reference in a new issue