From 16c6f48a1d1b22bae95583361a2440eaf73e2b07 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Tue, 7 Jan 2025 21:11:53 -0800 Subject: [PATCH] extract method to update shuttle data --- src/repositories/ApiBasedRepository.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/repositories/ApiBasedRepository.ts b/src/repositories/ApiBasedRepository.ts index 2aee8d4..17af7d3 100644 --- a/src/repositories/ApiBasedRepository.ts +++ b/src/repositories/ApiBasedRepository.ts @@ -129,7 +129,7 @@ export class ApiBasedRepository implements GetterRepository { } // Otherwise, call getShuttlesBySystemId to update the data - await this.getShuttlesBySystemId(shuttle.systemId); + await this.updateShuttlesForSystemIfTTL(shuttle.systemId); shuttle = this.cache.shuttleByShuttleId[shuttleId]; if (!shuttle) return null; @@ -144,6 +144,11 @@ export class ApiBasedRepository implements GetterRepository { return Promise.resolve([]); } + public async updateShuttlesForSystemIfTTL(systemId: string) { + // Update shuttleByShuttleId, shuttlesBySystemId, shuttlesByRouteId (future) + + } + public async getStopById(stopId: string): Promise<| null> { return null; }