Skip to content

Commit

Permalink
feat: user profile (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
adelinaenache authored May 28, 2024
1 parent eab41d2 commit 970789e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "location" TEXT;
1 change: 1 addition & 0 deletions src/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ model User {
id String @id @default(cuid())
email String? @unique
name String?
location String?
profilePictureUrl String?
socialAccounts SocialAccount[]
authType AuthType
Expand Down
1 change: 1 addition & 0 deletions src/schemas/user.properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const userProperties = {
isEmailVerified: { type: 'boolean' },
headline: { type: 'string' },
joinedAt: { type: 'string', format: 'date-time' },
location: { type: 'string' },
};

export const userExtraProps = {
Expand Down
10 changes: 10 additions & 0 deletions src/user/dto/update-user.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,14 @@ export class UpdateUserDto {
example: 'Software Engineer',
})
headline?: string;

@IsOptional()
@IsString()
@ApiProperty({
name: 'location',
description: 'User location',
required: false,
example: 'Bucharest, Romania',
})
location?: string;
}
1 change: 1 addition & 0 deletions src/user/service/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class UserService {
data: {
name: dto.name,
headline: dto.headline,
location: dto.location,
},
});
}
Expand Down

0 comments on commit 970789e

Please sign in to comment.