Skip to content

Commit

Permalink
#255 #259 changed parameter names to make it clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
marcos-lg committed Dec 1, 2020
1 parent a7b11c4 commit e59d754
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,21 @@ public void deleteOccurrenceMapping(

@PostMapping(value = "{key}/merge", consumes = MediaType.TEXT_PLAIN_VALUE)
@Secured({GRSCICOLL_ADMIN_ROLE, GRSCICOLL_EDITOR_ROLE})
public void merge(@PathVariable("key") UUID entityKey, @RequestBody UUID replacementKey) {
public void merge(@PathVariable("key") UUID entityKey, @RequestBody MergeParams params) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
mergeService.merge(entityKey, replacementKey, authentication.getName());
mergeService.merge(entityKey, params.replacementEntityKey, authentication.getName());
}

private static class MergeParams {
private UUID replacementEntityKey;

public UUID getReplacementEntityKey() {
return replacementEntityKey;
}

public void setReplacementEntityKey(UUID replacementEntityKey) {
this.replacementEntityKey = replacementEntityKey;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,21 @@ public UUID convertToCollection(
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
return institutionMergeService.convertToCollection(
entityKey,
params.institutionForNewCollection,
params.institutionForNewCollectionKey,
params.nameForNewInstitution,
authentication.getName());
}

private static final class ConvertToCollectionParams {
UUID institutionForNewCollection;
UUID institutionForNewCollectionKey;
String nameForNewInstitution;

public UUID getInstitutionForNewCollection() {
return institutionForNewCollection;
public UUID getInstitutionForNewCollectionKey() {
return institutionForNewCollectionKey;
}

public void setInstitutionForNewCollection(UUID institutionForNewCollection) {
this.institutionForNewCollection = institutionForNewCollection;
public void setInstitutionForNewCollectionKey(UUID institutionForNewCollectionKey) {
this.institutionForNewCollectionKey = institutionForNewCollectionKey;
}

public String getNameForNewInstitution() {
Expand Down

0 comments on commit e59d754

Please sign in to comment.