Skip to content

Commit

Permalink
MSTR-5: Filter completed port requests by modified date (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillegr123 authored May 8, 2019
1 parent 2561c83 commit 9496c8d
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/apps/common/submodules/portListing/portListing.js
Original file line number Diff line number Diff line change
Expand Up @@ -1174,25 +1174,31 @@ define(function(require) {
},

/**
* @param {Object} args
* @param {Function} args.success
* @param {String} args.tab
* @param {String} args.status
* @param {Object} args.filters
* @param {String} args.tab
* @param {String} args.type
* @param {Date} [args.fromDate]
* @param {Date} [args.toDate]
*/
portListingHelperListPorts: function(args) {
var self = this,
dates = monster.util.getDefaultRangeDates(self.appFlags.portListing.range),
fromDate = monster.util.dateToBeginningOfGregorianDay(_.get(args, 'fromDate', dates.from)),
toDate = monster.util.dateToBeginningOfGregorianDay(_.get(args, 'toDate', dates.to)),
filters = {
paginate: false,
by_types: args.type
};
},
dates,
fromDate,
toDate;

if (self.portListingIsTypeCompleted(args.type)) {
dates = monster.util.getDefaultRangeDates(self.appFlags.portListing.range);
fromDate = _.get(args, 'fromDate', dates.from);
toDate = _.get(args, 'toDate', dates.to);

filters = _.merge(filters, {
created_from: fromDate,
created_to: toDate
modified_from: monster.util.dateToBeginningOfGregorianDay(fromDate),
modified_to: monster.util.dateToEndOfGregorianDay(toDate)
});
}

Expand Down

0 comments on commit 9496c8d

Please sign in to comment.