Skip to content

[Frontend] Duplicate error handling#67

Merged
04mHuang merged 3 commits intomainfrom
duplicate-error-handling
Apr 12, 2025
Merged

[Frontend] Duplicate error handling#67
04mHuang merged 3 commits intomainfrom
duplicate-error-handling

Conversation

@04mHuang
Copy link
Collaborator

Check for duplicate investment types by passing investment types name array from InvestmentTypes section page to InvestmentTypesForm then just iterate and check over it.
Check for duplicate investments by adding each row's ${type}-${taxStatus} to a set and checking if the set's length is equal to the # of rows.

@04mHuang 04mHuang requested a review from kalongn April 11, 2025 22:40
@kalongn kalongn requested a review from Copilot April 11, 2025 22:52
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.

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

dupCheck.add(`${row.type}-${row.taxStatus}`)
}
});
if (dupCheck.size !== formData.length) {
Copy link
Owner

@kalongn kalongn Apr 11, 2025

Choose a reason for hiding this comment

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

It can convert to a for loop which if the current item exist in the set, can early exit. But not nesscary given this won't matter in terms of speed.

@04mHuang 04mHuang merged commit c20cd27 into main Apr 12, 2025
1 check passed
@04mHuang 04mHuang deleted the duplicate-error-handling branch April 12, 2025 00:01
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.

3 participants