Skip to content

48 Limit referrals to a maximum of 5 per submission#52

Merged
IvanA673 merged 11 commits intodevelopfrom
48-improving-main-page
May 27, 2025
Merged

48 Limit referrals to a maximum of 5 per submission#52
IvanA673 merged 11 commits intodevelopfrom
48-improving-main-page

Conversation

@suesuee
Copy link
Copy Markdown
Collaborator

@suesuee suesuee commented May 18, 2025

Developer: Sue Sue

Closes #48

Pull Request Summary

Limit the number of referrals to a maximum of 5 per submission.

Modifications

Added a server-side validation in api/referral/route.ts to reject requests with more than 5 prospects.

Updated components/ReferralForm.tsx to:

Prevent users from adding more than 5 referral fields.

Display a message when the limit is reached.

Cleaned up referralDataDrid code

Added Unit tests for route.ts

Testing Considerations

Confirm that the “+” button disappears or is disabled after adding 5 prospects.

Verify that the message “You’ve reached the max of 5 referrals.” appears when the limit is hit.

Test backend behavior via Postman:

Sending 6+ prospects should return a 400 error with the correct error message.

Confirm unit tests

Pull Request Checklist

  • Code is neat, readable, and works
  • Comments are appropriate
  • The commit messages follows our guidelines
  • The developer name is specified
  • The summary is completed
  • Assign reviewers

Screenshots/Screencast

image image

assets refactoring
image

error message fix
image

@suesuee suesuee requested a review from IvanA673 May 18, 2025 19:27
@IvanA673 IvanA673 merged commit ba16ab9 into develop May 27, 2025
4 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.

Debugging/Improving Main Page

4 participants