mirror of
https://github.com/kennethnym/aris.git
synced 2026-04-03 00:21:17 +01:00
fix: handle empty lines array in TFL source
Empty lines array caused fetchLineStatuses to build /Line//Status URL, resulting in a 404 from the TFL API. Now defaults to all lines when the array is empty. Also switches fetchStations to Promise.allSettled so individual line failures don't break the entire station fetch. Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -84,7 +84,7 @@ export class TflSource implements FeedSource<TflAlertFeedItem> {
|
||||
throw new Error("Either client or apiKey must be provided")
|
||||
}
|
||||
this.client = options.client ?? new TflApi(options.apiKey!)
|
||||
this.lines = options.lines ?? [...TflSource.DEFAULT_LINES_OF_INTEREST]
|
||||
this.lines = options.lines?.length ? options.lines : [...TflSource.DEFAULT_LINES_OF_INTEREST]
|
||||
}
|
||||
|
||||
async listActions(): Promise<Record<string, ActionDefinition>> {
|
||||
|
||||
Reference in New Issue
Block a user