Skip to content

Commit 370757f

Browse files
committed
refactor: reorganize imports and update endpoint routes in UserController
1 parent e5c6301 commit 370757f

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

server/src/user/user.controller.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
1-
import { Body, Controller, Get, Inject, Patch, Query } from '@nestjs/common';
2-
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
1+
import { Controller, Inject, Get, Patch, Body, Query } from '@nestjs/common';
2+
import { ApiTags, ApiBearerAuth, ApiOperation } from '@nestjs/swagger';
3+
import { GetRequestToken, validateUser } from '@server/GetRequestUser';
34
import { PageQueryDTO } from '@shared/validation/common/dto/PageQuery.dto';
45
import { GetUser } from '@shared/validation/user/dto/GetUser.dto';
5-
6-
import { GetRequestToken, validateUser } from '@server/GetRequestUser';
6+
import { UpdateUsernameDto } from '@shared/validation/user/dto/UpdateUsername.dto';
77

88
import { UserDocument } from './entity/user.entity';
99
import { UserService } from './user.service';
10-
import { UpdateUsernameDto } from '@shared/validation/user/dto/UpdateUsername.dto';
1110

1211
@Controller('user')
12+
@ApiTags('user')
13+
@ApiBearerAuth()
1314
export class UserController {
1415
constructor(
1516
@Inject(UserService)
1617
private readonly userService: UserService,
1718
) {}
1819

19-
@Get()
20-
@ApiTags('user')
21-
@ApiBearerAuth()
20+
@Get('by-query')
2221
async getUser(@Query() query: GetUser) {
2322
return await this.userService.getUserByEmailOrId(query);
2423
}
2524

26-
@Get()
27-
@ApiTags('user')
28-
@ApiBearerAuth()
25+
@Get('paginated')
2926
async getUserPaginated(@Query() query: PageQueryDTO) {
3027
return await this.userService.getUserPaginated(query);
3128
}

0 commit comments

Comments
 (0)