Skip to content

Commit

Permalink
refactor: (from PR feedback) consolidate if logic + add detail to com…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
knipec committed May 31, 2024
1 parent f2b9538 commit 3b6cfac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/soilId/soilIdService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export const fetchSoilMatches = async ({
}) => {
/*
* Depending on the given input parameters, one of the two APIs needs to be queried.
* Sites with data use the "data based" soil matches API, as it can use soil data and location
* Temporary locations use the "location based" soil matches API, only using location
*/
if (siteId && soilData) {
return fetchDataBasedSoilMatches(coords, soilDataToIdInput(soilData)).then(
Expand Down
4 changes: 1 addition & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ export const isEquivalentCoords = (a?: Coords, b?: Coords): boolean => {
a.latitude.toFixed(5) === b.latitude.toFixed(5) &&
a.longitude.toFixed(5) === b.longitude.toFixed(5)
);
} else if (a === undefined && b === undefined) {
return true;
} else {
return false;
return a === undefined && b === undefined;
}
};

Expand Down

0 comments on commit 3b6cfac

Please sign in to comment.