Skip to content

32302 Added wait before validate#300

Merged
severinbeauvais merged 2 commits intomainfrom
32302
Feb 5, 2026
Merged

32302 Added wait before validate#300
severinbeauvais merged 2 commits intomainfrom
32302

Conversation

@severinbeauvais
Copy link
Collaborator

Issue #: bcgov/entity#32302

Description of changes:

  • added wait to let postal code update before validate
  • updated some typing

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the business-filings-ui license (Apache 2.0).

@severinbeauvais severinbeauvais self-assigned this Feb 5, 2026
Copilot AI review requested due to automatic review settings February 5, 2026 23:02
this.postalCodeRulesEnabled = true
await Vue.nextTick() // ensure postal code rules are functional before validating
return this.$refs.addressForm.validate()
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The problem was that we didn't wait for the postal code component to process its rules (line 139) before we called to validate this form. So, the form didn't know if the postal code was invalid.

You'll be able to test this when I integrate it into Create UI :)

Copy link

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 addresses issue #32302 by adding a wait mechanism before validation in the BaseAddress component to ensure postal code rules are applied before validation runs. The change also includes improvements to method type annotations, replacing generic any types with specific types like Promise<boolean> and void.

Changes:

  • Made the validate() method async and added Vue.nextTick() to wait for postal code rules to be enabled before validation
  • Updated return type annotations for validate(), reset(), resetValidation(), and onCountryChange() methods from any to specific types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@severinbeauvais severinbeauvais merged commit 453665c into main Feb 5, 2026
6 of 7 checks passed
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