diff --git a/server/.gitignore b/server/.gitignore index a2e6062..4b5c03b 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -35,3 +35,8 @@ lerna-debug.log* !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json + +src/ncpAPI/test.ts +src/test.py +src/video/common.response.dto.ts +src/video/video.decorator.ts diff --git a/server/src/auth/auth.controller.ts b/server/src/auth/auth.controller.ts index 68b16ec..f7bc759 100644 --- a/server/src/auth/auth.controller.ts +++ b/server/src/auth/auth.controller.ts @@ -18,6 +18,7 @@ import { SigninRequestDto } from './dto/signin-request.dto'; import { RefreshRequestDto } from './dto/refresh-request.dto'; import { RefreshResponseDto } from './dto/refresh-response.dto'; +@ApiTags('AUTH') @Controller('auth') export class AuthController { constructor( @@ -29,7 +30,6 @@ export class AuthController { * 회원가입 */ @Post('signup') - @ApiTags('AUTH') @ApiSuccessResponse(201, '회원가입 성공', SignupResponseDto) @ApiFailResponse('인증 실패', [OAuthFailedException]) @ApiFailResponse('업로드 필요', [ProfileUploadRequiredException]) @@ -44,7 +44,6 @@ export class AuthController { * 로그인 */ @Post('login') - @ApiTags('AUTH') @ApiSuccessResponse(201, '로그인 성공', SigninResponseDto) @ApiFailResponse('인증 실패', [LoginFailException, OAuthFailedException]) signin( @@ -57,7 +56,6 @@ export class AuthController { * 토큰 재발급 */ @Post('refresh') - @ApiTags('AUTH') @ApiSuccessResponse(201, '토큰 재발급 성공', RefreshResponseDto) @ApiFailResponse('인증 실패', [InvalidRefreshTokenException]) refresh( diff --git a/server/src/user/user.service.ts b/server/src/user/user.service.ts index 25d6104..7b0db08 100644 --- a/server/src/user/user.service.ts +++ b/server/src/user/user.service.ts @@ -93,6 +93,10 @@ export class UserService { async getUploadedVideos(uuid: string, limit: number, lastId: string) { const uploaderData = await this.UserModel.findOne({ uuid }, { actions: 0 }); + if (!uploaderData) { + throw new UserNotFoundException(); + } + const { uploader, uploaderId } = await this.getUploaderInfo( uuid, uploaderData.toObject(), @@ -204,9 +208,9 @@ export class UserService { const videoData = await this.VideoModel.findOne({ _id: action.videoId, }).populate('uploaderId', '-_id -actions'); - const video = await this.videoService.getVideoInfo( - videoData.toObject(), - ); + const video = videoData + ? await this.videoService.getVideoInfo(videoData.toObject()) + : { video: null, uploader: null }; return { ...video, ratedAt: action.updatedAt }; }), );