Commits

Alvaro Videla committed 1b24e3a

removes magic number

  • Participants
  • Parent commits 10a0acd

Comments (0)

Files changed (1)

 , view_helpers = require('../lib/view_helpers.js')
 ;
 
+var MAX_IMAGES = 49;
+
 exports.index = function(req, res) {
-    // TODO remove magick numbers. Move them to configuraion
     var username = req.session.user ? req.session.user.name : null;
     var welcome_msg = view_helpers.getWelcomeMessage(req.session.user);
     var callback = view_helpers.imageList(res, req.session, username, welcome_msg);
 
     if (username == null) {
-        user_images.getLatestImages(0, 49, callback);
+        user_images.getLatestImages(0, MAX_IMAGES, callback);
     } else {
-        user_images.getUserTimeline(username, 0, 49, callback);
+        user_images.getUserTimeline(username, 0, MAX_IMAGES, callback);
     }
 };
 
-exports.latestImages = function(req, res) {
-    // TODO remove magick numbers. Move them to configuraion
+exports.latestImages = function(req, res) {    
     var username = req.session.user ? req.session.user.name : null;
     var welcome_msg = 'latest';
     var callback = view_helpers.imageList(res, req.session, username, welcome_msg);
-    user_images.getLatestImages(0, 49, callback);
+    user_images.getLatestImages(0, MAX_IMAGES, callback);
 };