Skip to content

Commit

Permalink
RESTWS-953:Support setting values of type "Location"
Browse files Browse the repository at this point in the history
  • Loading branch information
mogoodrich committed Aug 12, 2024
1 parent 5186c37 commit 58fd2a9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,19 +439,19 @@ public static void setValue(Obs obs, Object value) throws ParseException, Conver
// special case for Location
String potentialLocationUuid = null;

// if this is a representation of an object, so get uuid property as potential location uuid
// if this is a representation of an object, get the uuid property as potential location uuid
if (value instanceof Map) {
Object uuid = ((Map) value).get(RestConstants.PROPERTY_UUID);
if (uuid != null) {
potentialLocationUuid = uuid.toString();
}
}
else {
// otherwise, could this just uuid value
// otherwise, we will test if the value itself is a location uuid
potentialLocationUuid = value.toString();
}

// if there is a potential uuid, see if there is a matching location and set
// if there is a potential uuid, see if there is a matching location, and,if so, set the value text as the primary key
if (RestUtil.isUuid(potentialLocationUuid)) {
Location location = Context.getLocationService().getLocationByUuid(potentialLocationUuid);
if (location != null) {
Expand Down

0 comments on commit 58fd2a9

Please sign in to comment.