-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add latest changes api for local units
- validate the location - Revert API - add test cases
- Loading branch information
Showing
3 changed files
with
34 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
def format_local_unit(data: dict) -> dict: | ||
""" | ||
Formatting the json local unit data | ||
""" | ||
location = data.get("location_details", None) | ||
if location: | ||
coordinates = location.get("coordinates") | ||
data["location_json"] = { | ||
"type": location.get("type"), | ||
"lat": coordinates[1], | ||
"lng": coordinates[0], | ||
} | ||
return data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters