Skip to content

Commit

Permalink
fix: Remove unknown data (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
IdanDover committed Jan 27, 2024
1 parent 757c27e commit 56cb59a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/api/groupByService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,15 @@ export function useGroupBy({
groupbyAsync({ dateTo, dateFrom, groupBy })
.then((data) => {
setData(
data.map((dataRecord) => ({
...dataRecord,
operator_ref: agencyList.find(
(agency) => agency.agency_id === String(dataRecord.operator_ref),
),
})),
data
.map((dataRecord) => ({
...dataRecord,
operator_ref: agencyList.find(
(agency) => agency.agency_id === String(dataRecord.operator_ref),
),
}))
// should filter operator 22 (which is the Dankal TLV light train)
.filter((dataRecord) => dataRecord.operator_ref !== undefined),
)
})
.catch((er) => setError(er))
Expand Down

0 comments on commit 56cb59a

Please sign in to comment.