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

Improve data logger validation error messages #4603

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

perryr16
Copy link
Contributor

@perryr16 perryr16 commented Apr 2, 2024

Any background context you want to provide?

The data logger create/update modal had some hard coded error messages and backend logic that didn't align.

What's this PR do?

Dynamically displays error messages to the user
Refactors the create and update endpoints to use a serializer to validate data and generate errors.

Based on the existing data logger model, the only required fields are property, display_name, and is_occupied_data. I used this as the source of truth for refactoring the view logic.

How should this be manually tested?

Create/update a data logger, make sure error messages are applicable.

  • testing scenarios: name is empty, name is not unique. Otherwise, all other required fields are assigned in the backend

What are the relevant tickets?

#4592

Screenshots (if appropriate)

@perryr16 perryr16 added the Bug label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant