Skip to content

Commit

Permalink
add endpoints for retrieving other user data
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrokyr committed Aug 7, 2024
1 parent bff9623 commit 8745c52
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


}

0 comments on commit 8745c52

Please sign in to comment.