Skip to content

Commit

Permalink
Update API use with idx instead of name
Browse files Browse the repository at this point in the history
  • Loading branch information
MinThaMie committed Jul 18, 2023
1 parent f9c8bf6 commit c12128f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions netlify/functions/stations.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ exports.handler = async (event, context) => {
let shouldbeShown = false;
if (station.has_350_large == 't') {
const s350l = status350Large.fuelstation.find(
(s) => s.name == station.name
(s) => s.idx == station.idx
);
if (s350l && s350l.combinedstatus !== 'PLANNED') {
completeStation['status350l'] = s350l.combinedstatus;
Expand All @@ -59,7 +59,7 @@ exports.handler = async (event, context) => {
}
}
if (station.has_700_small == 't') {
const s700 = status700.fuelstation.find((s) => s.name == station.name);
const s700 = status700.fuelstation.find((s) => s.idx == station.idx);
if (s700 && s700.combinedstatus !== 'PLANNED') {
completeStation['status700'] = s700.combinedstatus;
completeStation['status700message'] = s700.combinedremark;
Expand All @@ -69,7 +69,7 @@ exports.handler = async (event, context) => {
}
if (station.has_350_small == 't') {
const s350s = status350Small.fuelstation.find(
(s) => s.name == station.name
(s) => s.idx == station.idx
);
if (s350s && s350s.combinedstatus !== 'PLANNED') {
completeStation['status350s'] = s350s.combinedstatus;
Expand Down

0 comments on commit c12128f

Please sign in to comment.