fix issue with updating root office details.
This commit is contained in:
+1
-1
@@ -133,7 +133,7 @@ public final class JsonCommand {
|
|||||||
return differenceExists;
|
return differenceExists;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean parameterExists(final String parameterName) {
|
public boolean parameterExists(final String parameterName) {
|
||||||
return this.fromApiJsonHelper.parameterExists(parameterName, parsedCommand);
|
return this.fromApiJsonHelper.parameterExists(parameterName, parsedCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -101,7 +101,12 @@ public class Office extends AbstractAuditableCustom<AppUser, Long> {
|
|||||||
final String localeAsInput = command.locale();
|
final String localeAsInput = command.locale();
|
||||||
|
|
||||||
final String parentIdParamName = "parentId";
|
final String parentIdParamName = "parentId";
|
||||||
if (command.isChangeInLongParameterNamed(parentIdParamName, this.parent.getId())) {
|
|
||||||
|
if (command.parameterExists(parentIdParamName) && this.parent == null) {
|
||||||
|
throw new RootOfficeParentCannotBeUpdated();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.parent != null && command.isChangeInLongParameterNamed(parentIdParamName, this.parent.getId())) {
|
||||||
final Long newValue = command.longValueOfParameterNamed(parentIdParamName);
|
final Long newValue = command.longValueOfParameterNamed(parentIdParamName);
|
||||||
actualChanges.put(parentIdParamName, newValue);
|
actualChanges.put(parentIdParamName, newValue);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user