contentRepository.deleteImage(client.getId(), image.getLocation());
}
}
private CommandProcessingResult updateClientImage(final Client client, final String imageLocation, final StorageType storageType) {
Image image = client.getImage();
if (image == null) {
image = new Image(imageLocation, storageType);
} else {
image.setLocation(imageLocation);
image.setStorageType(storageType.getValue());
}
this.imageRepository.save(image);
client.setImage(image);
this.clientRepositoryWrapper.save(client);
return new CommandProcessingResult(client.getId());