Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add helpUsImprove field to the backend #615

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions apps/api/src/auth/dto/register.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export class RegisterDto {
@IsBoolean()
public readonly newsletter?: boolean

@ApiProperty()
@Expose()
@IsOptional()
@IsBoolean()
public readonly helpUsImprove?: boolean

@ValidateIf((o) => o.type === ProfileType.CORPORATE)
@Expose()
@IsString()
Expand Down
1 change: 1 addition & 0 deletions schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ model Person {
updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz(6)
// Receive marketing notifications
newsletter Boolean? @default(false)
helpUsImporve Boolean? @default(false)
Copy link
Member

Choose a reason for hiding this comment

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

There is a typo. Change to helpUsImprove
We use snake_case for referencing a field via raw SQL query. Would you please add @Map("help_us_improve") at the end of this line.
Example:

helpUsImporve      Boolean?            @default(false) @map("help_us_improve")

Copy link
Member

@sashko9807 sashko9807 Mar 18, 2024

Choose a reason for hiding this comment

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

Please fix the typo, as well as add @map("help_us_improve"), as we use snake_case for referencing db fields directly

helpUsImporve      Boolean?            @default(false) @map("help_us_improve")

Then re-execute the yarn prisma migrate dev and yarn format

Edit: Linter is failing due to missing field field in personMock.
After you fix the above typo, please add helpUsImprove field to the personMock.ts

address String? @db.VarChar(100)
birthday DateTime? @db.Timestamptz(6)
emailConfirmed Boolean? @default(false) @map("email_confirmed")
Expand Down
Loading