diff --git a/src/repositories/UnoptimizedInMemoryRepository.ts b/src/repositories/UnoptimizedInMemoryRepository.ts index 18845ea..6aba616 100644 --- a/src/repositories/UnoptimizedInMemoryRepository.ts +++ b/src/repositories/UnoptimizedInMemoryRepository.ts @@ -148,28 +148,35 @@ export class UnoptimizedInMemoryRepository implements GetterSetterRepository { } } - removeSystemIfExists(systemId: string): Promise { - return Promise.resolve(null); + public async removeSystemIfExists(systemId: string): Promise { + const index = this.systems.findIndex((s) => s.id === systemId); + if (index > -1) { + const systemToReturn = this.systems[index]; + this.systems.splice(index, 1); + return systemToReturn; + } + + return null; } - removeRouteIfExists(routeId: string): Promise { - return Promise.resolve(null); + public async removeRouteIfExists(routeId: string): Promise { + return null; } - removeShuttleIfExists(shuttleId: string): Promise { - return Promise.resolve(null); + public async removeShuttleIfExists(shuttleId: string): Promise { + return null; } - removeStopIfExists(stopId: string): Promise { - return Promise.resolve(null); + public async removeStopIfExists(stopId: string): Promise { + return null; } - removeOrderedStopIfExists(stopId: string, routeId: string): Promise { - return Promise.resolve(null); + public async removeOrderedStopIfExists(stopId: string, routeId: string): Promise { + return null; } - removeEtaIfExists(shuttleId: string, stopId: string): Promise { - return Promise.resolve(null); + public async removeEtaIfExists(shuttleId: string, stopId: string): Promise { + return null; } public async clearSystemData() {