Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/database/factories/user.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default setSeederFactory(User, async () => {
user.lastName = lastName;
user.displayName = `${firstName} ${lastName}`;
user.birthdate = faker.date.birthdate({ min: 13, max: 65, mode: 'age' });
user.gender = faker.helpers.arrayElement(['male', 'female', 'other', 'preferNotToSay']);
user.gender = faker.helpers.arrayElement(['male', 'female']);
user.bio = faker.lorem.sentence();
user.avatarUrl = faker.image.avatar();
user.country = faker.location.country();
Expand Down
3 changes: 2 additions & 1 deletion src/notifications/notifications.swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export function ApiGetNotifications() {
name: 'type',
required: false,
type: String,
description: 'Filter by notification type (e.g., follow, like, repost, comment)',
description:
'Filter by notification type (new_follower, new_like, new_repost, new_comment, new_post)',
}),
ApiResponse({
status: HttpStatus.OK,
Expand Down
6 changes: 3 additions & 3 deletions src/user/dto/update-gender.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { IsIn } from 'class-validator';
export class UpdateGenderReqDto {
@ApiProperty({
description: 'Gender value',
enum: ['male', 'female', 'preferNotToSay'],
enum: ['male', 'female'],
example: 'male',
})
@IsIn(['male', 'female', 'preferNotToSay'], {
message: "Gender must be one of: 'male','female','preferNotToSay'",
@IsIn(['male', 'female'], {
message: "Gender must be one of: 'male','female'",
})
gender!: string;
}
6 changes: 3 additions & 3 deletions src/user/dto/update-profile-req.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ export class UpdateProfileReqDto {
city?: string;

@ApiPropertyOptional({
description: "Gender — accepted values: 'male', 'female', 'preferNotToSay'",
description: "Gender — accepted values: 'male', 'female'",
example: 'male',
enum: ['male', 'female', 'preferNotToSay'],
enum: ['male', 'female'],
})
@IsOptional()
@IsIn(['male', 'female', 'preferNotToSay'])
@IsIn(['male', 'female'])
gender?: string;

@ApiPropertyOptional({
Expand Down
19 changes: 8 additions & 11 deletions src/user/profile.swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export function ApiUpdateProfile() {
bio: { type: 'string', maxLength: 1000, example: 'Backend dev by day.' },
country: { type: 'string', maxLength: 100, example: 'EG' },
city: { type: 'string', maxLength: 100, example: 'Alexandria' },
gender: { type: 'string', enum: ['male', 'female', 'preferNotToSay'] },
gender: { type: 'string', enum: ['male', 'female'] },
favoriteGenres: {
type: 'array',
items: { type: 'string' },
Expand Down Expand Up @@ -227,7 +227,7 @@ export function ApiUpdateBirthdate() {
return applyDecorators(
ApiCookieAuth('access_token'),
ApiOperation({
summary: 'Update my birthdate',
summary: 'Update my birthdate - deprecated',
description:
"Updates the authenticated user's birthdate. Must be in YYYY-MM-DD format, not in the future, and the user must be at least 13 years old.",
}),
Expand Down Expand Up @@ -289,9 +289,8 @@ export function ApiUpdateGender() {
return applyDecorators(
ApiCookieAuth('access_token'),
ApiOperation({
summary: 'Update my gender',
description:
"Updates the authenticated user's gender. Accepted values: 'male', 'female', 'preferNotToSay'.",
summary: 'Update my gender - deprecated',
description: "Updates the authenticated user's gender. Accepted values: 'male', 'female'.",
}),
ApiResponse({
status: 200,
Expand All @@ -314,9 +313,7 @@ export function ApiUpdateGender() {
example: {
status: 'error',
message: 'Validation failed',
errors: [
{ field: 'gender', message: "Gender must be one of: 'male','female','preferNotToSay'" },
],
errors: [{ field: 'gender', message: "Gender must be one of: 'male','female'" }],
},
},
}),
Expand All @@ -329,7 +326,7 @@ export function ApiUpdatePrivacy() {
return applyDecorators(
ApiCookieAuth('access_token'),
ApiOperation({
summary: 'Change account privacy',
summary: 'Change account privacy - deprecated',
description:
"Toggles the authenticated user's account between public and private. Private accounts hide their content from non-followers.",
}),
Expand Down Expand Up @@ -368,7 +365,7 @@ export function ApiUpdateAvatar() {
ApiCookieAuth('access_token'),
ApiConsumes('multipart/form-data'),
ApiOperation({
summary: 'Update profile picture',
summary: 'Update profile picture - deprecated',
description:
"Updates the authenticated user's avatar/profile picture. The image is optimized, converted to WebP, and saved to S3.",
}),
Expand Down Expand Up @@ -422,7 +419,7 @@ export function ApiUpdateCover() {
ApiCookieAuth('access_token'),
ApiConsumes('multipart/form-data'),
ApiOperation({
summary: 'Update cover photo',
summary: 'Update cover photo - deprecated',
description: "Updates the authenticated user's cover photo and saves it to S3.",
}),
ApiBody({
Expand Down
Loading