Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove unknown data #438

Merged
merged 4 commits into from
Jan 27, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
),
}))
//NOTE: the problem comes from agencyList number 22 is not found. need to add the agency or remove it from the DB
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//NOTE: the problem comes from agencyList number 22 is not found. need to add the agency or remove it from the DB
// should filter operator 22 (which is the Dankal TLV light train)

.filter((dataRecord) => dataRecord.operator_ref !== undefined),
)
})
.catch((er) => setError(er))
Expand Down
Loading