mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add test for fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystemsInRepository
This commit is contained in:
@@ -98,9 +98,7 @@ export class ApiBasedRepositoryLoader {
|
||||
}
|
||||
}
|
||||
|
||||
public async fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystems() {
|
||||
// Fetch from the API
|
||||
// Pass JSON output into two different methods to update repository
|
||||
public async fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystemsInRepository() {
|
||||
const systems = await this.repository.getSystems();
|
||||
await Promise.all(systems.map(async (system: ISystem) => {
|
||||
await this.fetchAndUpdateStopAndPolylineDataForRoutesWithSystemId(system.id);
|
||||
@@ -108,6 +106,8 @@ export class ApiBasedRepositoryLoader {
|
||||
}
|
||||
|
||||
public async fetchAndUpdateStopAndPolylineDataForRoutesWithSystemId(systemId: string) {
|
||||
// Fetch from the API
|
||||
// Pass JSON output into two different methods to update repository
|
||||
const params = {
|
||||
getStops: "2",
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@ export class TimedApiBasedRepositoryLoader extends ApiBasedRepositoryLoader {
|
||||
await this.repository.clearRouteData();
|
||||
await this.fetchAndUpdateRouteDataForExistingSystemsInRepository();
|
||||
await this.repository.clearStopData();
|
||||
await this.fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystems();
|
||||
await this.fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystemsInRepository();
|
||||
await this.repository.clearShuttleData();
|
||||
await this.fetchAndUpdateShuttleDataForExistingSystems();
|
||||
await this.repository.clearEtaData();
|
||||
|
||||
Reference in New Issue
Block a user