diff --git a/README.md b/README.md index 80bb4caa..3c6fc7a0 100644 --- a/README.md +++ b/README.md @@ -246,7 +246,7 @@ It will also automatically check that the modified files comply with ESLint and ### Database -Bandada requires a SQL database to work, which is used by the `api` application. +Bandada requires an SQL database to work, which is used by the `api` application. Bandada can work with Postgres and SQLite. Other SQL flavors should work but have not been tested yet. You can pass the connection URL to the database using the environment variable (see below). @@ -260,7 +260,7 @@ yarn test ### Running in Docker -You can also run Bandada using Docker by running below command in the project root: +You can also run Bandada using Docker by running the below command in the project root: ```sh docker-compose up -d diff --git a/apps/api/src/app/groups/groups.controller.ts b/apps/api/src/app/groups/groups.controller.ts index cfd69d9a..3d205bcf 100644 --- a/apps/api/src/app/groups/groups.controller.ts +++ b/apps/api/src/app/groups/groups.controller.ts @@ -49,6 +49,17 @@ export class GroupsController { return groups.map((g) => mapGroupToResponseDTO(g)) } + @Get("/cachedgroups") + @ApiOperation({ description: "Returns the cached groups." }) + @ApiCreatedResponse() + async getCachedGroups() { + const groups = await this.groupsService.getCachedGroups() + + console.log("Controller", groups) + + return groups + } + @Get(":group") @ApiOperation({ description: "Returns a specific group." }) @ApiCreatedResponse({ type: Group }) diff --git a/apps/api/src/app/groups/groups.service.ts b/apps/api/src/app/groups/groups.service.ts index 3f3b26b0..9a106913 100644 --- a/apps/api/src/app/groups/groups.service.ts +++ b/apps/api/src/app/groups/groups.service.ts @@ -630,6 +630,12 @@ export class GroupsService { return group } + async getCachedGroups() { + console.log("Service", Array.from(this.cachedGroups.keys())) + + return Array.from(this.cachedGroups.keys()) + } + /** * Checks if a member belongs to a group. * @param groupId Group id.