VictorPavfurious commented on code in PR #4585:
URL: https://github.com/apache/fineract/pull/4585#discussion_r2053855234


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientFamilyMembersWritePlatformServiceImpl.java:
##########
@@ -354,26 +354,14 @@ public CommandProcessingResult updateFamilyMember(Long 
familyMemberId, JsonComma
 
     @Override
     public CommandProcessingResult deleteFamilyMember(Long 
clientFamilyMemberId, JsonCommand command) {
-        // TODO Auto-generated method stub
-
         this.context.authenticatedUser();
 
         apiJsonDeserializer.validateForDelete(clientFamilyMemberId);
 
-        ClientFamilyMembers clientFamilyMember = null;
-
-        if (clientFamilyMemberId != null) {
-            clientFamilyMember = 
clientFamilyRepository.getReferenceById(clientFamilyMemberId);
-            clientFamilyRepository.delete(clientFamilyMember);
-
-        }
+        ClientFamilyMembers clientFamilyMember = 
clientFamilyRepository.getReferenceById(clientFamilyMemberId);
+        clientFamilyRepository.delete(clientFamilyMember);

Review Comment:
   @adamsaghy , I thought about it, but change to deleteById might change api 
logic as - 
   If object not found - will has exception as EmptyResultDataAccessException 
instead of EntityNotFoundException. But if exception does not matter, so, yeah, 
i'd change this to deleteById:) 
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to