diff --git a/app/config/collections.php b/app/config/collections.php index 445da94337..237ed3e74f 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -1336,7 +1336,7 @@ $collections = [ [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Code Path', - 'key' => 'codePath', + 'key' => 'path', 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, @@ -1345,7 +1345,7 @@ $collections = [ [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Code Size', - 'key' => 'codeSize', + 'key' => 'size', 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => '', 'required' => false, diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index a582d56914..3863efdfff 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -401,11 +401,11 @@ App::post('/v1/functions/:functionId/tags') 'read' => [], 'write' => [], ], - 'dateCreated' => time(), 'functionId' => $function->getId(), + 'dateCreated' => time(), 'command' => $command, - 'codePath' => $path, - 'codeSize' => $size, + 'path' => $path, + 'size' => $size, ]); if (false === $tag) { @@ -413,7 +413,7 @@ App::post('/v1/functions/:functionId/tags') } $usage - ->setParam('storage', $tag->getAttribute('codeSize', 0)) + ->setParam('storage', $tag->getAttribute('size', 0)) ; $response->setStatusCode(Response::STATUS_CODE_CREATED); @@ -518,7 +518,7 @@ App::delete('/v1/functions/:functionId/tags/:tagId') $device = Storage::getDevice('functions'); - if ($device->delete($tag->getAttribute('codePath', ''))) { + if ($device->delete($tag->getAttribute('path', ''))) { if (!$projectDB->deleteDocument($tag->getId())) { throw new Exception('Failed to remove tag from DB', 500); } @@ -535,7 +535,7 @@ App::delete('/v1/functions/:functionId/tags/:tagId') } $usage - ->setParam('storage', $tag->getAttribute('codeSize', 0) * -1) + ->setParam('storage', $tag->getAttribute('size', 0) * -1) ; $response->noContent(); diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index fdb68c11c6..116cb6cfb2 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -332,7 +332,7 @@ App::get('/v1/projects/:projectId/usage') ) + $projectDB->getCount( [ - 'attribute' => 'codeSize', + 'attribute' => 'size', 'filters' => [ '$collection='.Database::SYSTEM_COLLECTION_TAGS, ], diff --git a/app/views/console/functions/function.phtml b/app/views/console/functions/function.phtml index 96ad1cf148..dca2af0f84 100644 --- a/app/views/console/functions/function.phtml +++ b/app/views/console/functions/function.phtml @@ -112,7 +112,7 @@ $timeout = $this->getParam('timeout', 900);