Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid lat/lon usePreference #1080

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

WesleyKoech
Copy link

Fix out-of-range lat/lon error when user sets values outside of (-180, 180) and (-90, 90) respectively. The error is as shown:
Screenshot from 2023-02-08 12-53-35

@tananaev
Copy link
Member

tananaev commented Feb 8, 2023

I think the right solution is to implement validation at the time you enter those values.

@WesleyKoech
Copy link
Author

It makes sense to add validations to both the endpoint for creating a user on the server-side and the user-add form in the web app.

@tananaev
Copy link
Member

tananaev commented Feb 8, 2023

Agree. Do you want to update this PR or create a separate one?

@WesleyKoech
Copy link
Author

Cool. I will update the current PR.

@@ -261,13 +261,23 @@ const UserPage = () => {
<TextField
type="number"
value={item.latitude || 0}
onChange={(event) => setItem({ ...item, latitude: Number(event.target.value) })}
onChange={(event) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need the same code on the server setting page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants