Skip to content

Commit

Permalink
feat(lending): 사서의 대출 제한 권수 4권으로 조정 (#826)
Browse files Browse the repository at this point in the history
* feat(lending): 사서의 대출 제한 권수 4권으로 조정

* style(lending): prettier 재적용
  • Loading branch information
nyj001012 committed Jul 13, 2024
1 parent d49f9a4 commit 04f6161
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/src/v1/lendings/lendings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ export const create = async (
0,
0,
);
if (numberOfLendings >= 2) {
// 사서는 4권, 일반 사용자는 2권까지 대출 가능
if (
(users[0].role === 2 && numberOfLendings >= 4) ||
(users[0].role !== 2 && numberOfLendings >= 2)
) {
throw new Error(errorCode.LENDING_OVERLOAD);
}
const penaltyEndDate = await lendingRepo.getUsersPenalty(userId);
Expand Down

0 comments on commit 04f6161

Please sign in to comment.