rename get system method on shuttle repository, update tests

This commit is contained in:
2025-04-06 09:48:55 -07:00
parent af61bd4726
commit 7e0c1f3539
6 changed files with 22 additions and 24 deletions

View File

@@ -39,7 +39,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
const query = new URLSearchParams(params).toString();
const systemIds = await this.constructExistingEntityIdSet(async () => {
return await this.repository.getSystems();
return await this.repository.getSystemIfExists();
})
try {
@@ -76,7 +76,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
}
public async fetchAndUpdateRouteDataForExistingSystemsInRepository() {
const systems = await this.repository.getSystems();
const systems = await this.repository.getSystemIfExists();
await Promise.all(systems.map(async (system) => {
await this.fetchAndUpdateRouteDataForSystemId(system.id);
}));
@@ -132,7 +132,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
}
public async fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystemsInRepository() {
const systems = await this.repository.getSystems();
const systems = await this.repository.getSystemIfExists();
await Promise.all(systems.map(async (system: ISystem) => {
await this.fetchAndUpdateStopAndPolylineDataForRoutesWithSystemId(system.id);
}));
@@ -178,7 +178,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
}
public async fetchAndUpdateShuttleDataForExistingSystemsInRepository() {
const systems = await this.repository.getSystems();
const systems = await this.repository.getSystemIfExists();
await Promise.all(systems.map(async (system: ISystem) => {
const systemId = system.id;
await this.fetchAndUpdateShuttleDataForSystemId(systemId);
@@ -244,7 +244,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
}
public async fetchAndUpdateEtaDataForExistingStopsForSystemsInRepository() {
const systems = await this.repository.getSystems()
const systems = await this.repository.getSystemIfExists()
await Promise.all(systems.map(async (system: ISystem) => {
const systemId = system.id;
await this.fetchAndUpdateEtaDataForExistingStopsForSystemId(systemId);