diff --git a/authentication.js b/authentication.js index 8825dd0..445cd08 100644 --- a/authentication.js +++ b/authentication.js @@ -31,7 +31,7 @@ module.exports = { passport.use('local-login', new LocalStrategy({ usernameField: 'username', passwordField: 'password', - passReqToCallback : true + passReqToCallback: true }, function(req, username, password, done) { User.findOne({ 'username' : username }, function(err, user) { @@ -175,7 +175,7 @@ module.exports = { email: req.user.email, orgs: req.user.orgs, isAdmin: req.user.isAdmin, - _id: req.user._id + _id: req.user._id }); } else { res.json({ @@ -378,7 +378,7 @@ module.exports = { }; /** - * A generic route callback type often called by authentication methods. + * A generic route callback type often called by authentication methods. <-- does the function associated w/ this header exist? * @callback nextRoute * @param {Object} req An Object representing the http request. * @param {Object} res An Object representing the http response. diff --git a/models/userModel.js b/models/userModel.js index 24b5796..0a7807e 100644 --- a/models/userModel.js +++ b/models/userModel.js @@ -72,7 +72,7 @@ User.statics.generateHash = function(password) { User.methods.validPassword = function(password) { var hash = this.password; return new Promise(function(resolve, reject) { - console.log(password); + console.log(password); // logging passwords is probably not a good idea! console.log(hash); bcrypt.compare(password, hash, function(err, res) { resolve(res); @@ -80,4 +80,4 @@ User.methods.validPassword = function(password) { }); }; -module.exports = mongoose.model("users", User); \ No newline at end of file +module.exports = mongoose.model("users", User); diff --git a/public/javascripts/client.js b/public/javascripts/client.js index deb6e8a..6e927c4 100644 --- a/public/javascripts/client.js +++ b/public/javascripts/client.js @@ -5,7 +5,7 @@ var app = angular.module('ledger', [ 'ngTouch', 'nvd3', 'ui.bootstrap', - 'smart-table' + 'smart-table' ]).config([ '$routeProvider', '$locationProvider', @@ -122,6 +122,8 @@ var app = angular.module('ledger', [ $locationProvider.html5Mode(true); }]).controller('NavigationCtrl', function($scope, $location) { + // why doesn't the navigation controller get its own file? + // I think it could, for consistency (unless there's a good reason it needs to be here) $scope.isActive = function (viewLocation) { return viewLocation === $location.path(); }; diff --git a/public/javascripts/controllers/AccountController.js b/public/javascripts/controllers/AccountController.js index f97b606..50c6841 100644 --- a/public/javascripts/controllers/AccountController.js +++ b/public/javascripts/controllers/AccountController.js @@ -76,11 +76,11 @@ app.controller('AccountController', function($uibModal, AuthService) { helpBlock: '' }, validate: function() { - var regex = new RegExp("^[a-zA-Z0-9]+$"); + var regex = new RegExp("^[a-zA-Z0-9]+$"); // give regex a more semantic variable name? e.g. var validPasswordRegex = ... if (typeof this.value !== 'string' || !regex.test(this.value)) { this.validation.isValid = 'invalid'; - this.validation.helpBlock = + this.validation.helpBlock = 'Password must only use letters and numbers and cannot be empty'; } else { this.validation.isValid = 'valid'; @@ -171,7 +171,7 @@ app.controller('AccountController', function($uibModal, AuthService) { }); } else { AccCtrl.currentPassword.validation.isValid = 'invalid'; - AccCtrl.currentPassword.validation.helpBlock = + AccCtrl.currentPassword.validation.helpBlock = 'Incorrect password'; } if (res.isSuccessful) { AccCtrl.closeEditPassword(); } @@ -196,4 +196,4 @@ app.controller('AccountController', function($uibModal, AuthService) { }; this.confirmNewPassword.value = ''; }; -}); \ No newline at end of file +}); diff --git a/public/javascripts/controllers/DashboardController.js b/public/javascripts/controllers/DashboardController.js index 3c2de58..7bb79a3 100644 --- a/public/javascripts/controllers/DashboardController.js +++ b/public/javascripts/controllers/DashboardController.js @@ -7,12 +7,7 @@ app.controller('DashboardController', function($scope, RequestService, AuthServi isCollapsed: true }; - - console.log("AuthService.currentUser"); - console.log(AuthService.currentUser); RequestService.getRequests(AuthService.currentUser._id).then(function(requests) { - console.log("requests"); - console.log(requests); DashCtrl.requests = requests; }); @@ -32,14 +27,12 @@ app.controller('DashboardController', function($scope, RequestService, AuthServi RequestService.editRequest(targetRequest).then(function(success){ - if(success){ - console.log("Modification Success"); - - }else{ - alert("Modification Failure"); + if (success) { + console.log("Modification Success"); // do you really need to log this? + } else { + alert("Modification Failure"); // Is an alert the right choice? I think you guys mostly use in-page error/validation messages... be consistent? } - }) - + }); }; this.cancel = function(index, ans){ @@ -48,15 +41,13 @@ app.controller('DashboardController', function($scope, RequestService, AuthServi targetRequest.isDecided = true; targetRequest.isActive = false; - console.log("targetRequest"); - console.log(targetRequest); RequestService.editRequest(targetRequest).then(function(success){ - if(success){ + if (success) { console.log("Modification Success"); - }else{ + } else { alert("Modification Failure"); } }) }; -}); \ No newline at end of file +}); diff --git a/public/javascripts/controllers/LoginController.js b/public/javascripts/controllers/LoginController.js index 47b1495..7f72269 100644 --- a/public/javascripts/controllers/LoginController.js +++ b/public/javascripts/controllers/LoginController.js @@ -21,4 +21,4 @@ app.controller('LoginController', function(AuthService) { this.dismissAlert = function(index) { this.alerts.splice(index, 1); }; -}); \ No newline at end of file +}); diff --git a/public/javascripts/controllers/MainController.js b/public/javascripts/controllers/MainController.js index d851a29..abea23e 100644 --- a/public/javascripts/controllers/MainController.js +++ b/public/javascripts/controllers/MainController.js @@ -13,7 +13,7 @@ app.controller('MainController', function($scope, $location, AuthService) { this.onPermissionsUpdate = function(user) { MainCtrl.user = user; AuthService.currentUser = user; - + // This is really clean var navRoutes = []; var authRoutes = [{ name: 'Login', @@ -60,4 +60,4 @@ app.controller('MainController', function($scope, $location, AuthService) { AuthService.registerPermissionsUpdateCallback(this.onPermissionsUpdate); -}); \ No newline at end of file +}); diff --git a/public/javascripts/controllers/ManageController.js b/public/javascripts/controllers/ManageController.js index e0def08..8a2b00a 100644 --- a/public/javascripts/controllers/ManageController.js +++ b/public/javascripts/controllers/ManageController.js @@ -36,6 +36,7 @@ app.controller('ManageController', function(AuthService, OrgService, RequestServ } }); }; + this.updateOrgs = function() { for (id in this.orgs) { this.orgs[id].ownersList = this.orgs[id].owners.map(function(owner) { @@ -166,7 +167,6 @@ app.controller('ManageController', function(AuthService, OrgService, RequestServ } }; - this.resolveUser = function(index, isApproved) { AuthService.resolveUser(this.pendingUsers[index], isApproved, this.pendingUsers[index].email).then(function(response) { MngCtrl.alert.isActive = true; @@ -206,9 +206,7 @@ app.controller('ManageController', function(AuthService, OrgService, RequestServ MngCtrl.updateOrgs(); }); - - - this.comment = { + this.comment = { value: '', validation: { isValid: 'empty', @@ -223,40 +221,27 @@ app.controller('ManageController', function(AuthService, OrgService, RequestServ this.validation.isValid = 'valid'; } } - } - - this.resolveFunRequest = function(index, ans){ - // this.isCollapsed = !this.isCollapsed; - // console.log("this.isCollapsed"); - // console.log(this.isCollapsed); - - - console.log(this.comment.value); + }; + this.resolveFunRequest = function(index, ans){ // again, semantic variable names -- what's a "fun request"? var targetRequest = MngCtrl.pendingFundRequests.splice(index, 1); - targetRequest = targetRequest[0] targetRequest.isDecided = true; targetRequest.comment = MngCtrl.comment.value - if(ans){ + if (ans) { targetRequest.isApproved = true; - }else{ + } else { targetRequest.isApproved = false; } - console.log("targetRequest"); - console.log(targetRequest); RequestService.editRequest(targetRequest).then(function(success){ - if(success){ - console.log("Modification Success"); + if (success) { MngCtrl.comment.value = ""; MngCtrl.isCollapsed = true; - }else{ + } else { alert("Modification Failure"); } }) }; - - -}); \ No newline at end of file +}); diff --git a/public/javascripts/controllers/OrgController.js b/public/javascripts/controllers/OrgController.js index 7722a18..fe8348c 100644 --- a/public/javascripts/controllers/OrgController.js +++ b/public/javascripts/controllers/OrgController.js @@ -1,8 +1,9 @@ // public/javascripts/controllers/OrgController.js app.controller('OrgController', function($routeParams, AuthService, - OrgService, $location, $window, $scope) { + OrgService, $location, $window, $scope) { // I've usually seen the parameters to an Angular controller alphabetized -- common convention var OrgCtrl = this; + // vv make sure to clear out hardcoded dummy data before you deploy this.transfers = [ { type: 'budget', from: 'SG', to: 'CORe', justification: '', value: 4 }, { type: 'transfer', from: 'SG', to: 'CORe' , justification: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas cursus venenatis arcu eget laoreet. Pellentesque in consectetur dolor. Nulla facilisi. Proin commodo auctor condimentum. Donec eu mauris id neque dapibus placerat. Mauris luctus urna sit amet mi iaculis eleifend. Nunc id tellus risus. Ut mollis lorem luctus, convallis eros sit amet, eleifend nulla. Integer elit tortor, vulputate quis auctor id, elementum et lectus.', value: 50 } @@ -298,4 +299,4 @@ app.controller('OrgController', function($routeParams, AuthService, }); }) }); -}) \ No newline at end of file +}) diff --git a/public/javascripts/controllers/RecordController.js b/public/javascripts/controllers/RecordController.js index 9e3b747..2a412e4 100644 --- a/public/javascripts/controllers/RecordController.js +++ b/public/javascripts/controllers/RecordController.js @@ -5,6 +5,7 @@ app.controller('RecordController', function(RecordService, RequestService, this.categories = ['Food', 'Consumable Supplies', 'Long Term Supplies', 'Service/Events']; + // These constructors are identical to the Field function in requestController -- could you modularize into a shared utils file, like you did serverside? or maybe a service? function Field(initialValue) { this.value = initialValue; this.isValidated = false; diff --git a/public/javascripts/controllers/RegisterController.js b/public/javascripts/controllers/RegisterController.js index f88bba1..8e59c70 100644 --- a/public/javascripts/controllers/RegisterController.js +++ b/public/javascripts/controllers/RegisterController.js @@ -28,7 +28,7 @@ app.controller('RegisterController', function(AuthService) { validate: function() { if (!this.value || this.value.length < 3) { this.validation.isValid = 'invalid'; - this.validation.helpBlock = + this.validation.helpBlock = 'Username must be at least 3 characters long'; } else { var username = this; @@ -82,7 +82,7 @@ app.controller('RegisterController', function(AuthService) { var regex = new RegExp("^[a-zA-Z0-9]+$"); if (!this.value || !regex.test(this.value)) { this.validation.isValid = 'invalid'; - this.validation.helpBlock = + this.validation.helpBlock = 'Password must only use letters and numbers'; } else { this.validation.isValid = 'valid'; @@ -97,7 +97,7 @@ app.controller('RegisterController', function(AuthService) { }; this.submitRegistrationForm = function() { - var RegCtrl = this; + var RegCtrl = this; // isn't this done globally? (this file, line 15) this.username.validate(); this.password.validate(); this.name.validate(); @@ -132,4 +132,4 @@ app.controller('RegisterController', function(AuthService) { }); } } -}); \ No newline at end of file +}); diff --git a/public/javascripts/controllers/SearchController.js b/public/javascripts/controllers/SearchController.js index 80970e2..cfef1d8 100644 --- a/public/javascripts/controllers/SearchController.js +++ b/public/javascripts/controllers/SearchController.js @@ -8,7 +8,7 @@ app.controller('SearchController', function($scope, OrgService, } }); - $scope.req = true; + $scope.req = true; // why not use full request/record instead of req/rec? Easier to read & maintain, in my opinion. $scope.rec = true; $scope.rowCollection = []; @@ -32,4 +32,4 @@ app.controller('SearchController', function($scope, OrgService, } }; -}); \ No newline at end of file +}); diff --git a/public/javascripts/directives/OrgListingDirective.js b/public/javascripts/directives/OrgListingDirective.js index 2a8ae73..6c84ba2 100644 --- a/public/javascripts/directives/OrgListingDirective.js +++ b/public/javascripts/directives/OrgListingDirective.js @@ -40,10 +40,10 @@ app.directive('listing', function ($compile) { link: function (scope, element, attrs) { scope.$watch('children', function() { if (scope.children[scope.parent].length > 0) { - element.append(""); + element.append(""); // recursion! This is cool. $compile(element.contents())(scope) } }) } } -}) \ No newline at end of file +}) diff --git a/public/javascripts/services/AuthService.js b/public/javascripts/services/AuthService.js index e19c18c..f13c8fc 100644 --- a/public/javascripts/services/AuthService.js +++ b/public/javascripts/services/AuthService.js @@ -98,6 +98,7 @@ app.service('AuthService', function($http, $q, $rootScope, $location) { var ifPermissionPassed = false; angular.forEach(validRoles, function (role) { + // This is really clean switch (role) { case roles.UNAUTH: if (!user.isAuthenticated) { diff --git a/public/javascripts/services/OrgService.js b/public/javascripts/services/OrgService.js index 6a0cbc9..29865f8 100644 --- a/public/javascripts/services/OrgService.js +++ b/public/javascripts/services/OrgService.js @@ -72,6 +72,18 @@ app.service('OrgService', function($http, $q) { return deferred.resolve(response.data); }); return deferred.promise; + /* + Not 100% sure, but you might be able to just + return $http.post('/api/createTransfer', { + org: org, + to: to, + from: from, + value: value, + justification: justification + }); + + ...$http.post is a promise, as evidenced by its .then method :) + */ }; -}); \ No newline at end of file +}); diff --git a/public/javascripts/services/RequestService.js b/public/javascripts/services/RequestService.js index 6d8c025..9615d71 100644 --- a/public/javascripts/services/RequestService.js +++ b/public/javascripts/services/RequestService.js @@ -14,35 +14,28 @@ app.service('RequestService', function($http, $q, $location) { this.editRequest = function(requestData) { var deferred = $q.defer(); - console.log(requestData); $http.post('/api/editRequest', requestData).then(function success(response) { - console.log("response.data: " + response.data.success); if (response.data.success == true){ deferred.resolve(response.data.success); - } - else{ + } else { // usually you all style your elses like this, I think -- consistency throughout, please :) deferred.reject(response.data.success); } - }); + }); // match indentation return deferred.promise; }; this.getRequests = function(requestData) { var deferred = $q.defer(); - console.log("request Service: "); - console.log(requestData); $http.get('/api/getRequests/' + requestData).then(function success(response) { - console.log("response.data: " + response.data.success); - console.log(response.data); - if (response.data.success == true){ - deferred.resolve(response.data.requests); - } - else{ - deferred.reject(response.data.success); - } + if (response.data.success == true){ + deferred.resolve(response.data.requests); + } + else{ + deferred.reject(response.data.success); + } }); - return deferred.promise; + return deferred.promise; }; this.getOrgRequests = function(orgValue){ @@ -54,9 +47,11 @@ app.service('RequestService', function($http, $q, $location) { }); return deferred.promise; }; -// funciton for redirecting url + // funciton for redirecting url this.go = function ( path ) { $location.path( path ); }; -}); \ No newline at end of file +}); + +// comments about consistency, removing console.logs etc. apply throughout code -- I'm catching some of them, but not all diff --git a/public/partials/dashboard2.html b/public/partials/dashboard2.html index 94492af..01d751c 100644 --- a/public/partials/dashboard2.html +++ b/public/partials/dashboard2.html @@ -1,4 +1,5 @@ +
@@ -6,7 +7,7 @@

Welcome to Ledger

This is a placeholder for the main landing page of Ledger. This page will eventually show a summary of the finances managed by Ledger.

-
+
@@ -65,4 +66,4 @@

{{request.created}} {{request


- \ No newline at end of file + diff --git a/public/partials/manage.html b/public/partials/manage.html index 3146d18..deeb4c4 100644 --- a/public/partials/manage.html +++ b/public/partials/manage.html @@ -79,6 +79,7 @@

Funding Requests

+ {{request.created| date}}        {{request.username}}        {{request.orgname}}       {{request.value| currency}}          {{request.isApproved === true ? "Approved" : "Declined"}}          {{request.isDecided === true ? "Decided" : "Undecided"}}
@@ -109,64 +110,6 @@

Funding Requests

- - - - - - -
@@ -204,13 +147,13 @@

Funding Requests

{{MngCtrl.comment.validation.helpBlock}}
-
+

- \ No newline at end of file + diff --git a/public/partials/org.html b/public/partials/org.html index e7183d7..90bf3d7 100644 --- a/public/partials/org.html +++ b/public/partials/org.html @@ -541,19 +541,4 @@ - - diff --git a/routes/routes.js b/routes/routes.js index 13b531f..5b1e525 100644 --- a/routes/routes.js +++ b/routes/routes.js @@ -169,7 +169,7 @@ var routes = { res.json({ isSuccessful: true, isAuthorized: - (req.user.orgs.indexOf(org._id) > -1 || req.user.isAdmin), + (req.user.orgs.indexOf(org._id) > -1 || req.user.isAdmin), // same as below -- no need to compute this twice org: (req.user.orgs.indexOf(org._id) > -1 || req.user.isAdmin) ? org : undefined @@ -177,13 +177,11 @@ var routes = { }) }) } else { + var isAuthorized = (req.user.orgs.indexOf(org._id) > -1 || req.user.isAdmin) // no need to compute this twice res.json({ isSuccessful: true, - isAuthorized: - (req.user.orgs.indexOf(org._id) > -1 || req.user.isAdmin), - org: (req.user.orgs.indexOf(org._id) > -1 || req.user.isAdmin) - ? org - : undefined + isAuthorized: isAuthorized, + org: isAuthorized ? org : undefined }); } @@ -412,18 +410,16 @@ var routes = { editRequest: function(req, res) { function confirm(err, request) { if (err) { - console.log("I fail " + err) + // Get rid of debugging mechanisms return res.send({ success: false, - message: 'ERROR:' + message: 'ERROR:' // not a useful error message }); } return res.send({ success: true, }); } - console.log(req.body); - console.log(req.body._id); Request.findById(req.body._id, function(err, request) { if (err) { return res.send({ @@ -431,8 +427,6 @@ var routes = { message: 'ERROR: Could not edit request' }); } - console.log(request); - console.log(req.body); request.description = req.body.description; request.value = req.body.value; @@ -577,23 +571,23 @@ var routes = { sendRegEmail: function(req, res){ console.log("got to email"); var email = req.params.email; - console.log(email); + console.log(email); // probably not good to log your users' email addresses... var payload = { to : email, - from : 'DONT.REPLY@ledger.com', + from : 'DONT.REPLY@ledger.com', // does this address exist? Maybe hide in process.env, also subject : 'Successful registration for ledger', text : 'Congradualtions! You are successfully registered for ledger. Go and check it out!' } sendgrid.send(payload, function(err, json) { if (err) { console.error(err); } console.log(json); - }); + }); }, sendReqEmail: function(req, res){ console.log("got to email"); var email = req.params.email; - console.log(email); + console.log(email); // same here, don't log emails var payload = { to : email, from : 'DONT.REPLY@ledger.com', @@ -603,7 +597,7 @@ var routes = { sendgrid.send(payload, function(err, json) { if (err) { console.error(err); } console.log(json); - }); + }); }, /** @@ -618,7 +612,6 @@ var routes = { pendingFundRequests: [] }; - // console.log("routes, getPendingFundRequests"); var orgs = req.user.orgs; var filteredOrgs = []; var pendingRequests = []; @@ -629,88 +622,57 @@ var routes = { Org.find({_id:{$in: orgs}}, function(err,orgs){ - // console.log("find org"); - + // please clean up dead code! particularly dead debugging mechanisms :/ orgs.forEach(function(org){ - // console.log(org.name); - if(org.budgeted){ - // console.log("is budgeted"); - if(org.nonterminal){ - // console.log("nonterminal"); + if (org.budgeted) { + if (org.nonterminal) { budgetedNonterminal.push(org._id); - }else{ - // console.log("terminal"); + } else { + // is this else block doing anything? } filteredOrgs.push(org._id); } - - }) - - // console.log("filteredOrgs: "); - // console.log(filteredOrgs); - // console.log("budgetedNonterminal: "); - // console.log(budgetedNonterminal); + }); // be consistent about semicolons and spacing budgetedNonterminal.forEach(function(pOrg){ tasks.push(function(callback){ - // console.log("parent: "); - // console.log(pOrg); Org.find({parent: pOrg, budgeted: false}, function(err,orgs){ - if(orgs.length > 0){ + if (orgs.length > 0) { orgs.forEach(function(org){ - // console.log("find children"); - // console.log(org.name); filteredOrgs.push(org._id); callback(null, null); - }) - }else{ - // console.log("no children!!!!!"); - callback(null, null); + }); + } else { + callback(null, null); } + }); + }); + }); - }) - }) - }) - - async.series(tasks, function(err, results){ - - // console.log("second round"); - // console.log("filteredOrgs: "); - console.log(filteredOrgs); - // console.log("budgetedNonterminal: "); - console.log(budgetedNonterminal); - + async.series(tasks, function(err, results){ // do you ever use the results? Don't need to name the param if it's unused. Request.find({org:{$in: filteredOrgs}, isActive: true, isDecided: false}, function(err, requests){ if (err || !requests) { return res.json(errorResponse); } requests.forEach(function(request){ pendingRequests.push(request); - // requestsUserId.push(request.user); - }) - tasks = []; + }); // is this the same as pendingRequests = requests? Not sure why you need the forEach. + tasks = []; // For the sake of clarity, I might name this variable differently -- a little weird to overwrite the existing "tasks" variable + // I think this forEach could be a tasks = pendingRequests.map(...) pendingRequests.forEach(function(request){ tasks.push(function(callback){ - // console.log("request.user"); - // console.log(request.user); User.find({_id:request.user}, function(err, users){ if (err || !users) { return res.json(errorResponse); } - // console.log("find the user: "); - // console.log(users[0].username); Org.find({_id: request.org}, function(err, orgs){ - // console.log("find the org: "); - // console.log(orgs[0].name); - var newRequest = JSON.parse(JSON.stringify(request)); - newRequest.username = users[0].username; - newRequest.orgname = orgs[0].name + var newRequest = JSON.parse(JSON.stringify(request)); + newRequest.username = users[0].username; + newRequest.orgname = orgs[0].name filtedPendingRequests.push(newRequest); callback(null, null); - }) - }) - }) - }) + }); + }); + }); + }); async.series(tasks, function(err, results){ - // console.log("filteredPendingRequests: "); - // console.log(filtedPendingRequests); res.json({pendingFundRequests: filtedPendingRequests}); }) }) @@ -722,4 +684,4 @@ var routes = { -module.exports = routes; \ No newline at end of file +module.exports = routes; diff --git a/server.js b/server.js index e2f21e4..009fdfb 100644 --- a/server.js +++ b/server.js @@ -20,7 +20,7 @@ * @requires NPM:connect-mongo * @requires NPM:less-middleware * @requires routes/routes - * @requires ultilities/startup + * @requires utilities/startup * @requires authentication */ diff --git a/utilities/startup.js b/utilities/startup.js index 44e4ad3..e507733 100644 --- a/utilities/startup.js +++ b/utilities/startup.js @@ -12,7 +12,7 @@ var User = require('../models/userModel'); var Org = require('../models/orgModel'); var q = require('q'); -var errors = { +var errors = { // I love this! ADMIN_FIND: 'Failure when attempting to find admin user', ADMIN_IMPOSSIBLE: 'Found neither 0 nor 1 number of admin users', ADMIN_SAVE: 'Could not save admin user', @@ -54,6 +54,8 @@ module.exports = { if (err) { return deferred.resolve(errors.ADMIN_FIND) }; switch (users.length) { case 0: + // You could hide the admin user login details in process.env variables, maybe -- + // as is, anyone who reads your code knows how to log into your system until you change the admin password User.generateHash('changePassword').then(function(hash) { User.create({ username: 'admin', @@ -80,4 +82,4 @@ module.exports = { return deferred.promise; } -}; \ No newline at end of file +}; diff --git a/utilities/validation.js b/utilities/validation.js index ad0236f..bd9a1fd 100644 --- a/utilities/validation.js +++ b/utilities/validation.js @@ -124,7 +124,7 @@ module.exports = { }) return isValid == 0; }, - request:function(description, value, orgId, links, items) { + request: function(description, value, orgId, links, items) { var requestValidator = this; return new Promise(function(resolve, reject) { Org.findById(orgId, function(err, org) { @@ -291,3 +291,4 @@ module.exports = { }; +// Your utility modules are super clean! Nice modularization.