|
1 | 1 | import { Body, Get, Patch, Post, Query, UseGuards } from '@nestjs/common'; |
2 | | -import { UserService } from '../user.service'; |
| 2 | +import { UserService } from '../services'; |
3 | 3 | import { |
4 | 4 | GetMeActivitySwagger, |
5 | 5 | GetMeSwagger, |
6 | | - PatchMeNotificationsSwagger, |
7 | 6 | PatchMeSwagger, |
8 | 7 | PostMeAvatarSwagger, |
9 | 8 | } from './user.swagger'; |
10 | | -import { UpdateNotificationsDto, UpdateProfileDto } from '../dtos'; |
| 9 | +import type { UpdateProfileDto } from '../dtos'; |
11 | 10 | import { ApiBaseController, ExtractFastifyFile, GetUserId } from '../../../shared/decorators'; |
12 | 11 | import { BearerAuthGuard } from '@shared/guards'; |
13 | | -import { PaginationDto } from '../../../shared/dtos'; |
14 | | -import { FileUploadDto } from '../../media/dtos'; |
| 12 | +import type { PaginationDto } from '../../../shared/dtos'; |
| 13 | +import type { FileUploadDto } from '../../media/dtos'; |
15 | 14 |
|
16 | | -@ApiBaseController('users', 'Users') |
| 15 | +@ApiBaseController('users/me', 'Account Profile') |
17 | 16 | @UseGuards(BearerAuthGuard) |
18 | 17 | export class UserController { |
19 | 18 | constructor(private readonly facade: UserService) {} |
20 | 19 |
|
21 | | - @Get('me') |
| 20 | + @Get() |
22 | 21 | @GetMeSwagger() |
23 | 22 | async getProfile(@GetUserId() id: string) { |
24 | 23 | return this.facade.getProfile(id); |
25 | 24 | } |
26 | 25 |
|
27 | | - @Patch('me') |
| 26 | + @Patch() |
28 | 27 | @PatchMeSwagger() |
29 | 28 | async updateProfile(@Body() dto: UpdateProfileDto, @GetUserId() id: string) { |
30 | 29 | return this.facade.updateProfile(id, dto); |
31 | 30 | } |
32 | 31 |
|
33 | | - @Patch('me/notifications') |
34 | | - @PatchMeNotificationsSwagger() |
35 | | - async updateNotifications(@Body() settings: UpdateNotificationsDto, @GetUserId() id: string) { |
36 | | - return this.facade.updateNotifications(id, settings); |
37 | | - } |
38 | | - |
39 | | - @Get('me/activity') |
| 32 | + @Get('activity') |
40 | 33 | @GetMeActivitySwagger() |
41 | 34 | async getActivity(@Query() query: PaginationDto, @GetUserId() id: string) { |
42 | 35 | return this.facade.getActivity(id, query.page, query.limit); |
43 | 36 | } |
44 | 37 |
|
45 | | - @Post('me/avatar') |
| 38 | + @Post('avatar') |
46 | 39 | @PostMeAvatarSwagger() |
47 | 40 | async uploadAvatar( |
48 | 41 | @ExtractFastifyFile() fileDto: FileUploadDto, |
|
0 commit comments