Skip to content

Commit ca6b593

Browse files
author
David Emory
committed
fix(api): Store the active searchId in state at beginning of each request
1 parent ff077a9 commit ca6b593

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/reducers/create-otp-reducer.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ function createOtpReducer (config, initialQuery) {
5555
query: clone(state.currentQuery),
5656
response: null,
5757
type: action.payload.routingType
58-
}}}
58+
}}},
59+
activeSearchId: { $set: searchId }
5960
})
6061
case 'ROUTING_ERROR':
6162
return update(state, {
@@ -66,16 +67,14 @@ function createOtpReducer (config, initialQuery) {
6667
}
6768
},
6869
pending: {$set: false}
69-
}},
70-
activeSearchId: { $set: searchId }
70+
}}
7171
})
7272
case 'ROUTING_RESPONSE':
7373
return update(state, {
7474
searches: {[searchId]: {
7575
response: {$set: action.payload.response},
7676
pending: {$set: false}
77-
}},
78-
activeSearchId: { $set: searchId }
77+
}}
7978
})
8079
case 'BIKE_RENTAL_REQUEST':
8180
return update(state, {

0 commit comments

Comments
 (0)