Skip to content

Conversation

Roshan-Metrix
Copy link

Included more robust client side validation

I've added two new functions, validateLogin() and validateRegister(), which check for empty fields on the respective forms. The login() and register() functions now call these validation functions before attempting to interact with the simulated backend. This ensures that the user is immediately notified of any missing information. I also corrected the id for the currency display on the dashboard from balance-currency to currency.

Key Improvements

  • Added validateLogin() and validateRegister() functions
    • These functions check for empty fields before backend interaction.
    • Prevents unnecessary API calls and improves user experience.
  • Integrated validation into login() and register() flows
    • Ensures form integrity before proceeding with account logic.
  • Corrected currency display ID
    • Changed balance-currency to currency for accurate DOM targeting and cleaner UI rendering.

Impact

  • Improves UX by catching input errors early.
  • Reduces backend load from invalid requests.
  • Enhances maintainability with modular validation logic.
  • Fixes a UI bug that could confuse users viewing account balances.

@Roshan-Metrix
Copy link
Author

@microsoft-github-policy-service agree
@microsoft-github-policy-service agree company="Roshan-Metrix"

@Roshan-Metrix
Copy link
Author

@microsoft-github-policy-service agree

@Roshan-Metrix
Copy link
Author

@microsoft-github-policy-service agree company="Microsoft"

@leestott
Copy link
Collaborator

leestott commented Oct 3, 2025

@Roshan-Metrix please fix branch conflicts

@leestott leestott requested a review from Copilot October 3, 2025 09:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the client-side validation for login and registration forms by adding pre-submission validation functions and fixes a UI bug related to currency display. The changes prevent unnecessary API calls by validating user input before attempting backend interactions.

  • Added validateLogin() and validateRegister() functions for client-side form validation
  • Integrated validation checks into existing login and registration flows
  • Fixed currency display element ID from balance-currency to currency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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