Skip to content

Commit

Permalink
feat: extend user description and tags (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
moshfeu authored Sep 26, 2021
1 parent 137af54 commit 4a68ae9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/modules/common/dto/user.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class UserDto {
readonly title: string;

@ApiModelPropertyOptional()
@Length(3, 140)
@Length(3, 400)
@IsString()
@IsOptional()
readonly description: string;
Expand Down Expand Up @@ -74,7 +74,7 @@ export class UserDto {
@ApiModelPropertyOptional()
@IsOptional()
@ArrayMinSize(1)
@ArrayMaxSize(5)
@ArrayMaxSize(10)
@IsString({
each: true,
})
Expand Down
6 changes: 4 additions & 2 deletions src/modules/users/users.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { ListDto } from '../lists/dto/list.dto';
import { ListsService } from '../lists/lists.service';
import { filterImages } from '../../utils/mimes';
import { MentorshipsService } from '../mentorships/mentorships.service';
import { Status } from '../mentorships/interfaces/mentorship.interface';

@ApiUseTags('/users')
@ApiBearerAuth()
Expand Down Expand Up @@ -168,8 +169,9 @@ export class UsersController {
user._id,
);
return mentorships.some(
({ mentee, mentor }) =>
mentor?._id.equals(user._id) || mentee?._id.equals(user._id),
({ mentee, mentor, status }) =>
status === Status.APPROVED &&
(mentor?._id.equals(user._id) || mentee?._id.equals(user._id)),
);
}

Expand Down

0 comments on commit 4a68ae9

Please sign in to comment.