diff --git a/lib/models/model_user.js b/lib/models/model_user.js index 6d8bdf6e6a5..e5c5543d801 100755 --- a/lib/models/model_user.js +++ b/lib/models/model_user.js @@ -7,8 +7,8 @@ // Dependencies var Config = require('../config/config'); var Utilities = require('../utilities/utilities'); -var AppDynamoDB = require('./model_aws').DynamoDB; -AppDynamoDB = new AppDynamoDB(); +var ModelDynamoDB = require('./model_aws').DynamoDB; +ModelDynamoDB = new ModelDynamoDB(); var moment = require('moment'); var bcryptjs = require('bcryptjs'); @@ -231,10 +231,10 @@ User.prototype.showByEmail = function(email, callback) { params.TableName = dynamodb_table; params.IndexName = "email-index"; params.KeyConditions = [ - AppDynamoDB.Condition("email", "EQ", email) + ModelDynamoDB.Condition("email", "EQ", email) ]; - AppDynamoDB.query(params, function(error, response) { + ModelDynamoDB.query(params, function(error, response) { if (error || !response) return callback({ status: 500, @@ -278,10 +278,10 @@ User.prototype.showByID = function(user_id, callback) { var params = {}; params.TableName = dynamodb_table; params.KeyConditions = [ - AppDynamoDB.Condition("_id", "EQ", user_id) + ModelDynamoDB.Condition("_id", "EQ", user_id) ]; - AppDynamoDB.query(params, function(error, response) { + ModelDynamoDB.query(params, function(error, response) { if (error || !response) return callback({ status: 500, @@ -382,7 +382,7 @@ User.prototype.save = function(user, callback) { if (params.UpdateExpression[params.UpdateExpression.length - 1] === ',') params.UpdateExpression = params.UpdateExpression.substring(0, params.UpdateExpression.length - 1); - AppDynamoDB.updateItem(params, function(error, response) { + ModelDynamoDB.updateItem(params, function(error, response) { if (error || !response) return callback({ status: 500,