Add notes to "compare" results

Fixes #22.
This commit is contained in:
Matthew Ryan Dillon 2015-10-19 14:30:13 -07:00
parent 8bae238685
commit dd4fbc4cf8

View file

@ -57,7 +57,11 @@ func HandleCompare(w http.ResponseWriter, r *http.Request) *types.AppError {
strainIDInt, _ := strconv.ParseInt(strainID, 10, 0)
for _, m := range *measurementsPayload.Measurements {
if (m.CharacteristicID == characteristicIDInt) && (m.StrainID == strainIDInt) {
values[strainID] = m.Value()
if m.Notes.Valid {
values[strainID] = fmt.Sprintf("%s (%s)", m.Value(), m.Notes.String)
} else {
values[strainID] = m.Value()
}
}
}
// If the strain doesn't have a measurement for this characteristic,