mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
implement route removal
This commit is contained in:
@@ -156,6 +156,13 @@ export class UnoptimizedInMemoryRepository implements GetterSetterRepository {
|
||||
}
|
||||
|
||||
public async removeRouteIfExists(routeId: string): Promise<IRoute | null> {
|
||||
const index = this.findEntityIndexById(routeId, this.routes);
|
||||
if (index > -1) {
|
||||
const routeToReturn = this.routes[index];
|
||||
this.routes.splice(index, 1);
|
||||
return routeToReturn;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user