diff --git a/src/app/entity/controllers/ListInstanceController.php b/src/app/entity/controllers/ListInstanceController.php index 32f48781d90185a0d4914d611b3e696dd88d1aae..d0fbd26a477a8ebbadbfed3365bd3b4ac4df9d20 100755 --- a/src/app/entity/controllers/ListInstanceController.php +++ b/src/app/entity/controllers/ListInstanceController.php @@ -158,7 +158,7 @@ class ListInstanceController $user = UserModel::getByLogin(['login' => $instance['item_id']]); if (empty($user)) { DatabaseModel::rollbackTransaction(); - return ['errors' => 'User not found', 'code' => 404]; + return ['errors' => 'User not found', 'code' => 400]; } } elseif ($instance['item_type'] == 'entity_id') { $entity = EntityModel::getByEntityId(['entityId' => $instance['item_id']]); diff --git a/src/app/indexingModel/controllers/IndexingModelController.php b/src/app/indexingModel/controllers/IndexingModelController.php index 57e03e35db1d3cbac00479edc00f6c808e09197c..7fd31243a3445b4d02ed37cc0692a5840a830206 100644 --- a/src/app/indexingModel/controllers/IndexingModelController.php +++ b/src/app/indexingModel/controllers/IndexingModelController.php @@ -330,7 +330,7 @@ class IndexingModelController } $resources = ResModel::get([ - 'select' => ['model_id'], + 'select' => ['1'], 'where' => ['model_id = ?'], 'data' => [$args['id']] ]); @@ -375,7 +375,8 @@ class IndexingModelController return $response->withStatus(204); } - public function disable(Request $request, Response $response, array $args) { + public function disable(Request $request, Response $response, array $args) + { if (!ServiceModel::hasService(['id' => 'admin_indexing_models', 'userId' => $GLOBALS['userId'], 'location' => 'apps', 'type' => 'admin'])) { return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']); } @@ -400,7 +401,8 @@ class IndexingModelController return $response->withStatus(204); } - public function enable(Request $request, Response $response, array $args) { + public function enable(Request $request, Response $response, array $args) + { if (!ServiceModel::hasService(['id' => 'admin_indexing_models', 'userId' => $GLOBALS['userId'], 'location' => 'apps', 'type' => 'admin'])) { return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']); }