-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(endpoint-posts): reading/editing geographic coordinates
- Loading branch information
1 parent
5a6cc36
commit f28325a
Showing
4 changed files
with
39 additions
and
19 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 |
---|---|---|
|
@@ -28,11 +28,15 @@ export const getGeoProperty = (geo) => { | |
|
||
/** | ||
Check warning on line 29 in packages/endpoint-posts/lib/utils.js GitHub Actions / test (20.x, 4)
|
||
* Get comma separated geographic coordinates | ||
* @param {object} geo - JF2 geo location property | ||
* @param {object} location - JF2 location property | ||
* @returns {string} Latitude and longitude, comma separated | ||
*/ | ||
export const getGeoValue = (geo) => { | ||
return [geo.latitude, geo.longitude].toString(); | ||
export const getGeoValue = (location) => { | ||
if (location && location.geo) { | ||
return [location.geo.latitude, location.geo.longitude].toString(); | ||
} else if (location && location.type === "geo") { | ||
return [location.latitude, location.longitude].toString(); | ||
} | ||
}; | ||
|
||
/** | ||
|
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