It is too much. This should probably go to the server


On Mon, Feb 24, 2014 at 4:47 PM, alxdarksage <notifications@github.com>wrote:

> In
> src/main/java/org/sagebionetworks/bridge/webapp/controllers/TrackerController.java:
>
> > +					}
> > +				});
> > +			}
> > +			// and sort all by date first taken
> > +			Collections.sort(historyRowsGrouped, new Comparator<List<ParticipantDataRow>>() {
> > +				@Override
> > +				public int compare(List<ParticipantDataRow> o1, List<ParticipantDataRow> o2) {
> > +					return (((ParticipantDataDatetimeValue) o1.get(0).getData().get(start)).getValue()
> > +							.compareTo(((ParticipantDataDatetimeValue) o2.get(0).getData().get(start)).getValue()));
> > +				}
> > +			});
> > +			model.addObject("current", currentRows);
> > +			model.addObject("past", historyRowsGrouped);
> > +			model.setViewName("journal/trackers/index");
> > +			return model;
> > +		}
>
> This is too much code for a controller method. Can you extract it out to a
> utility method, or do we need a controller just for the medication tracker?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/Sage-Bionetworks/Bridge/pull/94/files#r10019439>
> .
>