Skip to content
Extraits de code Groupes Projets
Valider fceb327a rédigé par safae.rabbouzi's avatar safae.rabbouzi
Parcourir les fichiers

add à message for client

parent a6b45efa
Branches
1 requête de fusion!11MLC-301/implement getClientById
Pipeline #19968 réussi avec les étapes
in 2 minutes et 32 secondes
...@@ -32,4 +32,6 @@ public class Message { ...@@ -32,4 +32,6 @@ public class Message {
public static final String ROLE_NAME_EMPTY = " role name cannot be empty"; public static final String ROLE_NAME_EMPTY = " role name cannot be empty";
public static final String ROLE_NAME_EXISTS = "A role with this email already exists:"; public static final String ROLE_NAME_EXISTS = "A role with this email already exists:";
public static final String ROLE_PERMISSIONS_EMPTY = "permissions cannot be empty"; public static final String ROLE_PERMISSIONS_EMPTY = "permissions cannot be empty";
public static final String CLIENT_NOT_FOUND = "Client not found with ID: ";
} }
\ No newline at end of file
...@@ -176,7 +176,7 @@ public class ClientServiceImpl implements ClientService { ...@@ -176,7 +176,7 @@ public class ClientServiceImpl implements ClientService {
@Override @Override
public ClientDTO getClientById(Long clientId) throws FunctionalException { public ClientDTO getClientById(Long clientId) throws FunctionalException {
Client client = clientRepository.findById(clientId) Client client = clientRepository.findById(clientId)
.orElseThrow(() -> new FunctionalException(Message.USER_NOT_FOUND + clientId)); .orElseThrow(() -> new FunctionalException(Message.CLIENT_NOT_FOUND + clientId));
return ClientDTO.builder() return ClientDTO.builder()
.id(client.getId()) .id(client.getId())
......
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter