Skip to content

Commit 4a68ae9

Browse files
authored
feat: extend user description and tags (#234)
1 parent 137af54 commit 4a68ae9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/modules/common/dto/user.dto.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class UserDto {
4444
readonly title: string;
4545

4646
@ApiModelPropertyOptional()
47-
@Length(3, 140)
47+
@Length(3, 400)
4848
@IsString()
4949
@IsOptional()
5050
readonly description: string;
@@ -74,7 +74,7 @@ export class UserDto {
7474
@ApiModelPropertyOptional()
7575
@IsOptional()
7676
@ArrayMinSize(1)
77-
@ArrayMaxSize(5)
77+
@ArrayMaxSize(10)
7878
@IsString({
7979
each: true,
8080
})

src/modules/users/users.controller.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { ListDto } from '../lists/dto/list.dto';
3737
import { ListsService } from '../lists/lists.service';
3838
import { filterImages } from '../../utils/mimes';
3939
import { MentorshipsService } from '../mentorships/mentorships.service';
40+
import { Status } from '../mentorships/interfaces/mentorship.interface';
4041

4142
@ApiUseTags('/users')
4243
@ApiBearerAuth()
@@ -168,8 +169,9 @@ export class UsersController {
168169
user._id,
169170
);
170171
return mentorships.some(
171-
({ mentee, mentor }) =>
172-
mentor?._id.equals(user._id) || mentee?._id.equals(user._id),
172+
({ mentee, mentor, status }) =>
173+
status === Status.APPROVED &&
174+
(mentor?._id.equals(user._id) || mentee?._id.equals(user._id)),
173175
);
174176
}
175177

0 commit comments

Comments
 (0)