hasadna / open-bus-map-search

open-bus-map-search
https://open-bus-map-search.hasadna.org.il/dashboard
MIT License
51 stars 90 forks source link

new agencies should appear in the dashboard #789

Closed NoamGaash closed 3 months ago

NoamGaash commented 3 months ago

we should call https://open-bus-stride-api.hasadna.org.il/gtfs_agencies/list?date_from=2024-06-01 with dynamic date argument to make sure new agencies appear

EyalIlan commented 3 months ago

hey can i take this issue? please :)

NoamGaash commented 3 months ago

sure

EyalIlan commented 3 months ago

yay thanks :) I will start working on it

NoamGaash commented 3 months ago

another task (for separate pr) - add "דרך אגד" to the list of important operators

asidelnik commented 3 months ago

@NoamGaash What does dynamic date mean?

Should date_from equal each date's current date? Ex: today: 2024-06-11, tomorrow: 2024-06-12

Or should it equal each month's first date? (as in api url in this issue's description) Ex: today: 2024-06-01, next month: 2024-07-01

The updated function in file agencyList.ts _Need to understand which variable to pass to the datefrom: todayDate or firstDateInMonth?

export default async function getAgencyList(): Promise<Agency[]> {
  if (!agencyList) {
    const now = moment()
    const todayDate = now.clone().format('YYYY-MM-DD')
    const firstDateInMonth = now.clone().startOf('month').format('YYYY-MM-DD')
    const response = await fetch(`${BASE_PATH}/gtfs_agencies/list?date_from=${firstDateInMonth}`)

    const data = (await response.json()) as Awaited<Agency[]>
    agencyList = data.filter(Boolean) // filter empty entries
  }
  return agencyList
}
NoamGaash commented 3 months ago

I think providing yesterday's date would be the safest approach, but it's up to you to decide.

asidelnik commented 3 months ago

@NoamGaash Can you give me push & pull request permissions? If you are wondering how I got here, it's through Dorit & yesterday's Hasadna meeting. I was listening in the Zoom meeting.

NoamGaash commented 3 months ago

@asidelnik Welcome! It's great to see you here :clap:

NoamGaash commented 3 months ago

image

is it related?