searchView: various code improvements
This commit is contained in:
parent
1a3556679b
commit
8fc01cf986
|
@ -227,7 +227,7 @@ export const search = async (requestId) => {
|
|||
if (Object.entries(suggestionsCache.from).length !== 0) {
|
||||
from = suggestionsCache.from;
|
||||
} else {
|
||||
let suggestions = await get("/suggestions", {"query": ElementById('from').value, "results": 1}, true);
|
||||
let suggestions = await get("/suggestions", {"query": fromValue, "results": 1}, true);
|
||||
|
||||
if (!suggestions[0]) {
|
||||
showAlertModal("Abfahrtsbahnof ungültig");
|
||||
|
@ -242,10 +242,10 @@ export const search = async (requestId) => {
|
|||
} else if (Object.entries(suggestionsCache.via).length !== 0) {
|
||||
via = suggestionsCache.via;
|
||||
} else {
|
||||
let suggestions = await get("/suggestions", {"query": ElementById('via').value, "results": 1}, true);
|
||||
let suggestions = await get("/suggestions", {"query": viaValue, "results": 1}, true);
|
||||
|
||||
if (!suggestions[0]) {
|
||||
showAlertModal("Ankunftsbahnhof ungültig");
|
||||
showAlertModal("Via-Bahnhof ungültig");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -255,7 +255,7 @@ export const search = async (requestId) => {
|
|||
if (Object.entries(suggestionsCache.to).length !== 0) {
|
||||
to = suggestionsCache.to;
|
||||
} else {
|
||||
let suggestions = await get("/suggestions", {"query": ElementById('to').value, "results": 1}, true);
|
||||
let suggestions = await get("/suggestions", {"query": toValue, "results": 1}, true);
|
||||
|
||||
if (!suggestions[0]) {
|
||||
showAlertModal("Ankunftsbahnhof ungültig");
|
||||
|
|
Loading…
Reference in a new issue