Skip to content

Commit

Permalink
Merge pull request #169 from boostcampwm-2024/be/feature/order
Browse files Browse the repository at this point in the history
[BE/refactor] 주문 검증 로직 응답 형식 수정
  • Loading branch information
HBLEEEEE authored Dec 4, 2024
2 parents 97f9346 + d6944f4 commit 8c98d37
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions apps/backend/src/account/guards/hasSufficientCashGuard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { CanActivate, ExecutionContext, ForbiddenException, Injectable } from '@nestjs/common';
import {
CanActivate,
ExecutionContext,
HttpException,
HttpStatus,
Injectable
} from '@nestjs/common';
import { AccountService } from '../account.service';

@Injectable()
Expand All @@ -20,7 +26,7 @@ export class HasSufficientCashGuard implements CanActivate {
}

if (!hasEnoughCash) {
throw new ForbiddenException('사용 가능한 현금이 부족합니다.');
throw new HttpException('사용 가능한 현금이 부족합니다.', HttpStatus.FORBIDDEN);
}

return true;
Expand Down
10 changes: 8 additions & 2 deletions apps/backend/src/account/guards/hasSufficientCropGuard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { CanActivate, ExecutionContext, ForbiddenException, Injectable } from '@nestjs/common';
import {
CanActivate,
ExecutionContext,
HttpException,
HttpStatus,
Injectable
} from '@nestjs/common';
import { AccountService } from '../account.service';

@Injectable()
Expand All @@ -20,7 +26,7 @@ export class HasSufficientCropGuard implements CanActivate {
}

if (!hasEnoughCrop) {
throw new ForbiddenException('작물을 충분히 보유하고 있지 않습니다.');
throw new HttpException('작물을 충분히 보유하고 있지 않습니다.', HttpStatus.FORBIDDEN);
}

return true;
Expand Down

0 comments on commit 8c98d37

Please sign in to comment.