Code is not picking the last update date - fix

- Sorted dates to pick up the last one
- Changed url on grunt file for development environment config

Signed-off-by: Teresita de Jesus Guerrero Vela <teresita.guerrero.vela@intel.com>
This commit is contained in:
Teresita de Jesus Guerrero Vela 2017-01-13 12:28:23 -06:00
parent f2a471f285
commit b2e41cf7ad
2 changed files with 10 additions and 12 deletions

View File

@ -83,12 +83,10 @@ module.exports = function(UserStory) {
Patch.latestUpdate(userStory.source, function (err, response, next) {
response = JSON.parse(response.substring(5));
console.log('response', response);
if(response.length > 0){
lastUpdate = response.map( function each (element){
return element.updated
}).sort().shift();
}).sort().pop();
var arrayLastUpdate = lastUpdate.split(' ');
lastUpdate = arrayLastUpdate[0];

View File

@ -314,7 +314,7 @@ module.exports = function (grunt) {
development: {
constants: function() {
var config = require('./' + grunt.config.get('ngconstant.options.configPath'))
config.apiBaseUrl = 'http://localhost:3004';
config.apiBaseUrl = 'http://localhost:3004/api';
return { appConfig : config};
}
},