|
|
|
@ -93,8 +93,9 @@ class StopTimeForm extends Component {
|
|
|
|
|
}) |
|
|
|
|
apiClient(`/stop/?search=${inputValue}`, { cancelToken }) |
|
|
|
|
.then((resp) => { |
|
|
|
|
callback(resp.data.results.map(ele => Object.assign(ele, { |
|
|
|
|
value: ele.id, label: ele.name |
|
|
|
|
callback(resp.data.results.map(i => ({ |
|
|
|
|
...i, |
|
|
|
|
label: i.name |
|
|
|
|
}))) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -115,8 +116,7 @@ class StopTimeForm extends Component {
|
|
|
|
|
<AsyncSelect |
|
|
|
|
cacheOptions={true} |
|
|
|
|
defaultOptions |
|
|
|
|
defaultValue={item.stop && Object.assign(item.stop, { |
|
|
|
|
label: item.stop.name})} |
|
|
|
|
defaultValue={item.stop && {...item.stop, label: item.stop.name}} |
|
|
|
|
loadOptions={this.getStops} |
|
|
|
|
components={{ Option }} |
|
|
|
|
onChange={(item, evt) => { |
|
|
|
|