Skip to content

Commit

Permalink
When get_lot_as_json without recursive, return "owner"
Browse files Browse the repository at this point in the history
To distinguish between a lot's personal owner and those who own the lot through
inheritance, the `get_lot_as_json` function will return something like
```
"owners": ["owner1", "owner2"]
```
when called with recursion, and something like
```
"owner": "owner1"
```
when called without.

The distinction here is that "owner" MUST map to the lot's personal owner,
whereas "owners" is a list of all owners, including the personal owner.
  • Loading branch information
jhiemstrawisc committed Feb 23, 2024
1 parent df8a684 commit 5641588
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lotman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,7 @@ int lotman_get_lot_as_json(const char *lot_name, const bool recursive, char **ou
output_obj["owners"] = rp_vec_str.first;
}
else {
output_obj["owners"] = rp_vec_str.first[0]; // Only one owner, this is where it will be.
output_obj["owner"] = rp_vec_str.first[0]; // Only one owner, this is where it will be.
}

// Add parents according to recursive flag
Expand Down

0 comments on commit 5641588

Please sign in to comment.