Skip to content

Commit

Permalink
fix: make transitIndex stops comprehensive list instead of rewriting …
Browse files Browse the repository at this point in the history
…on each call
  • Loading branch information
amy-corson-ibigroup committed Oct 21, 2024
1 parent 6084739 commit a8e5a5d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/reducers/create-otp-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ function createOtpReducer(config) {
transitIndex: {
stops: {
$set: {
...state.transitIndex.stops,
[action.payload.stopId]: {
fetchStatus: FETCH_STATUS.FETCHING
}
Expand All @@ -856,8 +857,11 @@ function createOtpReducer(config) {
return update(state, {
transitIndex: {
stops: {
[action.payload.stopId]: {
fetchStatus: { $set: FETCH_STATUS.FETCHING }
$set: {
...state.transitIndex.stops,
[action.payload.stopId]: {
fetchStatus: FETCH_STATUS.FETCHING
}
}
}
}
Expand All @@ -867,7 +871,10 @@ function createOtpReducer(config) {
return update(state, {
transitIndex: {
stops: {
[action.payload.gtfsId]: { $set: action.payload }
$set: {
...state.transitIndex.stops,
[action.payload.gtfsId]: action.payload
}
}
}
})
Expand Down

0 comments on commit a8e5a5d

Please sign in to comment.