Skip to content

Conversation

@tompscanlan
Copy link
Contributor

@tompscanlan tompscanlan commented Jan 7, 2026

Summary

  • Allow users with single names (like "Cher" or "Madonna") to register
  • Changed @IsNotEmpty to @IsOptional on lastName field in registration DTO
  • Added comprehensive DTO validation tests

Background

The frontend registration form now uses a single "full name" field that splits into firstName/lastName. Users entering a single name would get firstName="Cher", lastName="", which was being rejected by the backend.

Test plan

  • Added unit tests for DTO validation (7 tests passing)
  • Manual test: Register with single name like "Cher"

Related

Users with single names (like "Cher" or "Madonna") should be able to
register. The frontend splits a single name into firstName only.

- Changed @isnotempty to @IsOptional on lastName field
- Made lastName optional with ? suffix
- Added comprehensive DTO validation tests

Relates to: OpenMeet-Team/openmeet-platform#349
The AuthRegisterLoginDto allows lastName to be undefined, but CreateUserDto
expects string | null. Use nullish coalescing to convert undefined to null.
The generateShortCode() uses nanoid's urlAlphabet which includes underscores.
Existing slugs in the wild may contain underscores, so the validation regex
must accept them to allow slug updates.
Change @isnotempty() to @IsOptional() to allow users to be created
without a last name.
The PATCH /api/v1/auth/me endpoint was rejecting empty lastName values
due to @isnotempty() validation. Removed to allow users to clear lastName.
@tompscanlan tompscanlan merged commit fc128f0 into main Jan 8, 2026
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.

2 participants