diff --git a/src/databaseQueries/entities.js b/src/databaseQueries/entities.js index 2059b34..070053b 100644 --- a/src/databaseQueries/entities.js +++ b/src/databaseQueries/entities.js @@ -15,8 +15,8 @@ module.exports = class entities { return resolve(entityData) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) } @@ -40,8 +40,8 @@ module.exports = class entities { return resolve(entityData) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) } @@ -64,8 +64,8 @@ module.exports = class entities { return resolve(entityData) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) } @@ -90,8 +90,8 @@ module.exports = class entities { return resolve(updatedCategories) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) } @@ -144,8 +144,8 @@ module.exports = class entities { return resolve(document) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) } @@ -204,8 +204,8 @@ module.exports = class entities { return resolve(entitiesDocuments) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) } diff --git a/src/databaseQueries/entityTypes.js b/src/databaseQueries/entityTypes.js index 5578273..5da3641 100644 --- a/src/databaseQueries/entityTypes.js +++ b/src/databaseQueries/entityTypes.js @@ -74,15 +74,14 @@ module.exports = class EntityTypes { return resolve(entityData) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) } }) } - /** * find entityType documents. * @method @@ -129,16 +128,14 @@ module.exports = class EntityTypes { return resolve(document) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) } }) } - - /** * Update entityTypes documents. * @method @@ -161,8 +158,8 @@ module.exports = class EntityTypes { return resolve(entityTypeData) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) } diff --git a/src/databaseQueries/userRoleExtension.js b/src/databaseQueries/userRoleExtension.js index 09376c0..f9bc6e9 100644 --- a/src/databaseQueries/userRoleExtension.js +++ b/src/databaseQueries/userRoleExtension.js @@ -18,8 +18,8 @@ module.exports = class userRoleExtension { return resolve(userRoleData) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) } @@ -44,8 +44,8 @@ module.exports = class userRoleExtension { return resolve(userData) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) } @@ -100,8 +100,8 @@ module.exports = class userRoleExtension { return resolve(userDocuments) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) } @@ -121,8 +121,8 @@ module.exports = class userRoleExtension { return resolve(userData) } catch (error) { return reject({ - status: error.status || HTTP_STATUS_CODE.internal_server_error.status, - message: error.message || HTTP_STATUS_CODE.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE.bad_request.status, + message: error.message || HTTP_STATUS_CODE.bad_request.message, errorObject: error, }) }