Skip to content

Commit

Permalink
fix(editor): fix trip writes for non-frequency based trips
Browse files Browse the repository at this point in the history
  • Loading branch information
landonreed committed Feb 15, 2018
1 parent ef765d9 commit dcaa7e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/editor/components/timetable/TimetableEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ export default class TimetableEditor extends Component {
// If a frequency-based trip, never use exact times. NOTE: there is no
// column to edit this field in the timetable grid.
objectPath.set(newRow, 'frequencies.0.exactTimes', 0)
} else {
// If not using frequencies, set frequencies to empty array so that SQL backend
// is happy.
objectPath.set(newRow, 'frequencies', [])
}
objectPath.set(newRow, 'feedId', this.props.feedSource.id)
objectPath.set(newRow, 'patternId', activePattern.patternId)
Expand Down

0 comments on commit dcaa7e0

Please sign in to comment.