We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d49f9a4 commit 04f6161Copy full SHA for 04f6161
1 file changed
backend/src/v1/lendings/lendings.service.ts
@@ -36,7 +36,11 @@ export const create = async (
36
0,
37
38
);
39
- if (numberOfLendings >= 2) {
+ // 사서는 4권, 일반 사용자는 2권까지 대출 가능
40
+ if (
41
+ (users[0].role === 2 && numberOfLendings >= 4) ||
42
+ (users[0].role !== 2 && numberOfLendings >= 2)
43
+ ) {
44
throw new Error(errorCode.LENDING_OVERLOAD);
45
}
46
const penaltyEndDate = await lendingRepo.getUsersPenalty(userId);
0 commit comments