Skip to content

Commit 0ed9d86

Browse files
committedJun 8, 2023
feat: add organizations to API (LAN-764)
1 parent 9c74eba commit 0ed9d86

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
 

‎docs/api.md

+6
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ The response is always a list of dictionaries, like this:
110110
"special_provisions": [
111111
{ "id": "Behindertentauglich", "short_code": "H" }
112112
],
113+
"organizations": [
114+
{
115+
"id": "AVS-001",
116+
"organization_name": "AV \"Aktive Angler\" e. V."
117+
}
118+
],
113119
"geojson": {
114120
"type": "FeatureCollection",
115121
"features": []

‎landa/api.py

+6
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ def water_body(id: str = None, fishing_area: str = None) -> List[Dict]:
114114
fields=["water_body_special_provision as id", "short_code"],
115115
)
116116

117+
water_body["organizations"] = frappe.get_all(
118+
"Water Body Management Local Organization",
119+
filters={"water_body": water_body["id"]},
120+
fields=["organization as id", "organization_name"],
121+
)
122+
117123
if water_body.location:
118124
water_body["geojson"] = json.loads(water_body.location)
119125

0 commit comments

Comments
 (0)
Please sign in to comment.