Closed NoamGaash closed 3 months ago
hey can i take this issue? please :)
sure
yay thanks :) I will start working on it
another task (for separate pr) - add "דרך אגד" to the list of important operators
@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
}
I think providing yesterday's date would be the safest approach, but it's up to you to decide.
@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.
@asidelnik Welcome! It's great to see you here :clap:
is it related?
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