Skip to content

Commit bf26c94

Browse files
committed
add Government translation to the returning model
1 parent cce7d28 commit bf26c94

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

government-service/src/main/java/com/csaba79coder/bestprotocol/model/representative/service/RepresentativeService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,9 @@ public List<RepresentativeAdminModel> renderAllRepresentativesByGovernmentId(Str
6363
}
6464

6565
private RepresentativeAdminModel getRepresentativeWithTranslation(UUID representativeId, String languageShortName) {
66-
// TODO previous job title list!
6766
Representative currentRepresentative = representativeRepository.findById(representativeId).orElseThrow(() -> new NoSuchElementException("Representative not found"));
6867
GovernmentTranslation governmentTranslation = governmentTranslationRepository.findByGovernmentIdAndLanguageShortName(currentRepresentative.getGovernment().getId(), languageShortName);
6968
RepresentativeTranslation currentTranslation = representativeTranslationRepository.findRepresentativeTranslationByLanguageShortNameAndRepresentativeId(languageShortName, currentRepresentative.getId());
70-
7169
if (currentTranslation != null) {
7270
RepresentativeTranslationManagerModel model = new RepresentativeTranslationManagerModel();
7371
model.setId(currentTranslation.getId());
@@ -108,6 +106,7 @@ private RepresentativeAdminModel getRepresentativeWithTranslation(UUID represent
108106
.updatedAt(String.valueOf(currentRepresentative.getUpdatedAt()))
109107
.createdBy(currentRepresentative.getCreatedBy())
110108
.updatedBy(currentRepresentative.getUpdatedBy())
109+
.government(Mapper.mapGovernmentTranslationToAdminModel(governmentTranslation))
111110
.phoneNumber(currentRepresentative.getPhoneNumber())
112111
.email(currentRepresentative.getEmail())
113112
.image(ImageUtil.decompressImage(currentRepresentative.getImage()))

0 commit comments

Comments
 (0)