Skip to content

Commit

Permalink
Fixed decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
shahanneda committed Jun 2, 2024
1 parent f8547cd commit 5149f94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion backend/app/services/implementations/user_service.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from decimal import Decimal
import firebase_admin.auth
from ...models.user_info import UserInfo

Expand Down Expand Up @@ -459,7 +460,7 @@ def get_asp_near_location(self, requestor_id, max_distance, limit, offset):
kwargs = {
"id": str(asp_distance["_id"]),
"info": asp_distance["info"],
"distance": asp_distance["distance"],
"distance":round(Decimal(asp_distance["distance"]), 2),
}
asp_distance_dtos.append(ASPDistanceDTO(**kwargs))
except Exception as e:
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/donor/NearbySchoolList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const NearbySchoolList = ({

<Text>
Partner with a school in your community that aligns with your
donation preferences.
donation preferences. Only showing schools that are within 100km of
your location.
</Text>
</Flex>
<Flex flex="1" padding="0 7vw" flexDirection="column">
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/YourMatchesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import AuthContext from "../contexts/AuthContext";
import { ErrorMessage } from "../utils/ErrorUtils";
import { logPossibleGraphQLError } from "../utils/GraphQLUtils";

const MAX_DISTANCE = 50;
// This distance is in KM
const MAX_DISTANCE = 100;

const YourMatchesPage = (): React.ReactElement => {
const { authenticatedUser, setAuthenticatedUser } = useContext(AuthContext);
Expand Down

0 comments on commit 5149f94

Please sign in to comment.