diff --git a/backend/src/main/java/meetona/department/DepartmentService.java b/backend/src/main/java/meetona/department/DepartmentService.java index c360a7c..2099fff 100644 --- a/backend/src/main/java/meetona/department/DepartmentService.java +++ b/backend/src/main/java/meetona/department/DepartmentService.java @@ -84,7 +84,7 @@ public ApiResponse add(DepartmentRequest request) { public ApiResponse update(UUID id, DepartmentRequest request) { boolean isUnitExists = repository.existsById(id); - if(isUnitExists) { + if(!isUnitExists) { throw new AppException("Id does not exists"); } @@ -105,7 +105,7 @@ public ApiResponse update(UUID id, DepartmentRequest request) { public ApiResponse delete(UUID id) { boolean isDepartmentExists = repository.existsById(id); - if(isDepartmentExists){ + if(!isDepartmentExists){ throw new ResourceNotFoundException("User", "id", id); } diff --git a/backend/src/main/java/meetona/meeting/MeetingService.java b/backend/src/main/java/meetona/meeting/MeetingService.java index f5eadbd..623f6a0 100644 --- a/backend/src/main/java/meetona/meeting/MeetingService.java +++ b/backend/src/main/java/meetona/meeting/MeetingService.java @@ -75,7 +75,7 @@ public ApiResponse add(MeetingRequest request) { public ApiResponse update(UUID id, MeetingRequest request) { boolean isMeetingExists = meetingRepository.existsById(id); - if(isMeetingExists) { + if(!isMeetingExists) { throw new AppException("Id does not exists"); } @@ -96,7 +96,7 @@ public ApiResponse update(UUID id, MeetingRequest request) { public ApiResponse delete(UUID id) { boolean isUnitExists = meetingRepository.existsById(id); - if(isUnitExists){ + if(!isUnitExists){ throw new ResourceNotFoundException("User", "id", id); } diff --git a/backend/src/main/java/meetona/member/MemberService.java b/backend/src/main/java/meetona/member/MemberService.java index 421e0db..bba94ec 100644 --- a/backend/src/main/java/meetona/member/MemberService.java +++ b/backend/src/main/java/meetona/member/MemberService.java @@ -107,7 +107,7 @@ public ApiResponse add(MemberRequest request) { public ApiResponse update(UUID id, MemberRequest request) { boolean isUnitExists = memberRepository.existsById(id); - if(isUnitExists) { + if(!isUnitExists) { throw new AppException("Id does not exists"); } @@ -128,7 +128,7 @@ public ApiResponse update(UUID id, MemberRequest request) { public ApiResponse delete(UUID id) { boolean isUnitExists = memberRepository.existsById(id); - if(isUnitExists){ + if(!isUnitExists){ throw new ResourceNotFoundException("User", "id", id); } diff --git a/backend/src/main/java/meetona/unit/UnitService.java b/backend/src/main/java/meetona/unit/UnitService.java index a2d14de..54aff06 100644 --- a/backend/src/main/java/meetona/unit/UnitService.java +++ b/backend/src/main/java/meetona/unit/UnitService.java @@ -82,7 +82,7 @@ public ApiResponse add(UnitRequest request) { public ApiResponse update(UUID id, UnitRequest request) { boolean isUnitExists = unitRepository.existsById(id); - if(isUnitExists) { + if(!isUnitExists) { throw new ResourceNotFoundException("User", "id", id); } @@ -103,7 +103,7 @@ public ApiResponse update(UUID id, UnitRequest request) { public ApiResponse delete(UUID id) { boolean isUnitExists = unitRepository.existsById(id); - if(isUnitExists){ + if(!isUnitExists){ throw new ResourceNotFoundException("User", "id", id); } diff --git a/backend/src/main/java/meetona/user/UserService.java b/backend/src/main/java/meetona/user/UserService.java index f2a5fc2..4157a0a 100644 --- a/backend/src/main/java/meetona/user/UserService.java +++ b/backend/src/main/java/meetona/user/UserService.java @@ -125,7 +125,7 @@ public ApiResponse add(UserRequest userRequest) { public ApiResponse update(UUID id, UserRequest request) { boolean isUserExists = userRepository.existsById(id); - if(isUserExists) { + if(!isUserExists) { throw new ResourceNotFoundException("User", "id", id); } @@ -146,7 +146,7 @@ public ApiResponse update(UUID id, UserRequest request) { public ApiResponse delete(UUID id) { boolean isUserExists = userRepository.existsById(id); - if(isUserExists){ + if(!isUserExists){ throw new ResourceNotFoundException("User", "id", id); }