From 8745c526a263dc58c75bcff1a0c9915ce4ec077b Mon Sep 17 00:00:00 2001 From: Dmytro Kyrii Date: Wed, 7 Aug 2024 16:56:19 +0200 Subject: [PATCH 1/2] add endpoints for retrieving other user data --- .../modules/web-api/folders/folders.controller.ts | 7 +++++++ .../web-api/notebooks/notebooks.controller.ts | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/quix-frontend/service/src/modules/web-api/folders/folders.controller.ts b/quix-frontend/service/src/modules/web-api/folders/folders.controller.ts index 6c7ed0245..86ae3ceda 100644 --- a/quix-frontend/service/src/modules/web-api/folders/folders.controller.ts +++ b/quix-frontend/service/src/modules/web-api/folders/folders.controller.ts @@ -30,6 +30,13 @@ export class FoldersController { return list; } + @Get('/user/:email/files') + async getUserFullTree(@Param('email') email: string) { + const list = await this.foldersService.getFilesForUser(email); + + return list; + } + @Get('files/:id') async getSpecificFolder(@Param('id') id: string) { const folder = this.foldersService.getFolder(id); diff --git a/quix-frontend/service/src/modules/web-api/notebooks/notebooks.controller.ts b/quix-frontend/service/src/modules/web-api/notebooks/notebooks.controller.ts index f4efa7277..db853bcf9 100644 --- a/quix-frontend/service/src/modules/web-api/notebooks/notebooks.controller.ts +++ b/quix-frontend/service/src/modules/web-api/notebooks/notebooks.controller.ts @@ -29,4 +29,18 @@ export class NotebookController { return notebook; } + + @Get(':id/:email') + @UseGuards(AuthGuard) + async getUserNotebook(@Param('email') email: string, @Param('id') id: string) { + const notebook = await this.notebookService.getNotebook(email, id); + + if (!notebook) { + throw new HttpException(`Can't find notebook`, HttpStatus.NOT_FOUND); + } + + return notebook; + } + + } From 6054e5071696f933b3911f61f22f887de666bfd4 Mon Sep 17 00:00:00 2001 From: Dmytro Kyrii Date: Wed, 7 Aug 2024 16:59:39 +0200 Subject: [PATCH 2/2] bump version --- quix-frontend/service/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quix-frontend/service/package.json b/quix-frontend/service/package.json index e06535dfe..b3953d65b 100644 --- a/quix-frontend/service/package.json +++ b/quix-frontend/service/package.json @@ -1,6 +1,6 @@ { "name": "@wix/quix-service", - "version": "1.0.33", + "version": "1.0.34", "description": "", "author": "", "license": "MIT",