Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/api/user/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,12 @@ export class UserController {
@Query('handle') handle: string,
): Promise<DTOs.ValidationResponseDto> {
this.logger.log(`Validating handle: ${handle}`);
if (!handle) {
throw new BadRequestException('Handle is required.');
if (
!handle ||
typeof handle !== "string" ||
(Array.isArray(handle))

Choose a reason for hiding this comment

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

[💡 maintainability]
The check Array.isArray(handle) is redundant since typeof handle !== 'string' already covers non-string types, including arrays. Consider removing it for simplicity.

) {
throw new BadRequestException('Handle is required and must be a string.');
}
return this.validationService.validateHandle(handle);
}
Expand Down
Loading