diff --git a/modules/entities/lang/en.php b/modules/entities/lang/en.php index 0044daa51970110d7a7b58a4e9118907cdf045b4..6e706136d0fd3e47b200c19bf4b46a69712f213a 100755 --- a/modules/entities/lang/en.php +++ b/modules/entities/lang/en.php @@ -89,6 +89,9 @@ if (!defined('_ENTITY_IS_RELATED')) { if (!defined('_TYPE')) { define('_TYPE', 'Type'); } +if (!defined('_ENTITY_ALREADY_EXISTS')) { + define('_ENTITY_ALREADY_EXISTS', 'Entity already exists'); +} /*************************** Users - Entites management *****************/ if (!defined('_ENTITY_USER_DESC')) { diff --git a/modules/entities/lang/fr.php b/modules/entities/lang/fr.php index cd61a35f2d2eb613842df98c1fb163b692567046..0c8cb9cbc270aedb0cd923ffde5bc3b9cb95fc5e 100755 --- a/modules/entities/lang/fr.php +++ b/modules/entities/lang/fr.php @@ -89,6 +89,9 @@ if (!defined('_ENTITY_IS_RELATED')) { if (!defined('_TYPE')) { define('_TYPE', 'Type'); } +if (!defined('_ENTITY_ALREADY_EXISTS')) { + define('_ENTITY_ALREADY_EXISTS', 'Cette entité existe déjà '); +} /*************************** Users - Entites management *****************/ if (!defined('_ENTITY_USER_DESC')) { diff --git a/src/app/entity/controllers/EntityController.php b/src/app/entity/controllers/EntityController.php index e05b4ca0088ef59e85f005cff82ca537a13279cc..d62ee942331a5bc2e97dbfef394c91d93b2a0b64 100644 --- a/src/app/entity/controllers/EntityController.php +++ b/src/app/entity/controllers/EntityController.php @@ -171,7 +171,7 @@ class EntityController $existingEntity = EntityModel::getById(['entityId' => $data['entity_id'], 'select' => [1]]); if (!empty($existingEntity)) { - return $response->withStatus(400)->withJson(['errors' => 'Entity already exists']); + return $response->withStatus(400)->withJson(['errors' => _ENTITY_ALREADY_EXISTS]); } EntityModel::create($data);