Skip to content

Commit

Permalink
refactor(be): minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-won-hyeok committed Sep 24, 2024
1 parent 89d3476 commit c01bd91
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 28 deletions.
3 changes: 0 additions & 3 deletions apps/backend/apps/client/src/notice/notice.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Get,
Query,
Param,
Logger,
DefaultValuePipe,
ParseBoolPipe
} from '@nestjs/common'
Expand All @@ -14,8 +13,6 @@ import { NoticeService } from './notice.service'
@Controller('notice')
@AuthNotNeededIfOpenSpace()
export class NoticeController {
private readonly logger = new Logger(NoticeController.name)

constructor(private readonly noticeService: NoticeService) {}

@Get()
Expand Down
14 changes: 2 additions & 12 deletions apps/backend/apps/client/src/notice/notice.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,10 @@ export class NoticeService {
}
}

const prev = await this.prisma.notice.findFirst(navigate('prev'))
const next = await this.prisma.notice.findFirst(navigate('next'))

if (!prev) {
throw new EntityNotExistException('prev notice')
}
if (!next) {
throw new EntityNotExistException('next notice')
}

return {
current,
prev,
next
prev: await this.prisma.notice.findFirst(navigate('prev')),
next: await this.prisma.notice.findFirst(navigate('next'))
}
}
}
5 changes: 0 additions & 5 deletions apps/backend/apps/client/src/user/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Req,
Res,
Controller,
Logger,
Delete,
Query
} from '@nestjs/common'
Expand All @@ -25,8 +24,6 @@ import { UserService } from './user.service'

@Controller('user')
export class UserController {
private readonly logger = new Logger(UserController.name)

constructor(private readonly userService: UserService) {}

@Patch('password-reset')
Expand Down Expand Up @@ -95,8 +92,6 @@ export class UserController {
@Controller('email-auth')
@AuthNotNeededIfOpenSpace()
export class EmailAuthenticationController {
private readonly logger = new Logger(EmailAuthenticationController.name)

constructor(private readonly userService: UserService) {}

setJwtInHeader(res: Response, jwt: string) {
Expand Down
12 changes: 4 additions & 8 deletions apps/backend/apps/client/src/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,14 +584,10 @@ export class UserService {
throw new UnprocessableDataException('Bad new password')
}

try {
encryptedNewPassword = await hash(
updateUserDto.newPassword,
ARGON2_HASH_OPTION
)
} catch (error) {
throw new UnprocessableDataException(error.message)
}
encryptedNewPassword = await hash(
updateUserDto.newPassword,
ARGON2_HASH_OPTION
)
}

const updateData = {
Expand Down

0 comments on commit c01bd91

Please sign in to comment.