Skip to content

Commit

Permalink
🔀 Merged fix
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Feb 25, 2024
1 parent 938bcde commit 083498e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion packages/api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ model crm_companies {
id_linked_user String? @db.Uuid
crm_addresses crm_addresses[]
crm_users crm_users? @relation(fields: [id_crm_user], references: [id_crm_user], onDelete: NoAction, onUpdate: NoAction, map: "fk_24")
crm_deals crm_deals[]
crm_email_addresses crm_email_addresses[]
crm_engagements crm_engagements[]
crm_notes crm_notes[]
Expand Down Expand Up @@ -138,13 +139,16 @@ model crm_deals {
id_crm_user String? @db.Uuid
id_crm_deals_stage String? @db.Uuid
id_linked_user String? @db.Uuid
id_crm_company String? @db.Uuid
crm_deals_stages crm_deals_stages? @relation(fields: [id_crm_deals_stage], references: [id_crm_deals_stage], onDelete: NoAction, onUpdate: NoAction, map: "fk_21")
crm_users crm_users? @relation(fields: [id_crm_user], references: [id_crm_user], onDelete: NoAction, onUpdate: NoAction, map: "fk_22")
crm_companies crm_companies? @relation(fields: [id_crm_company], references: [id_crm_company], onDelete: NoAction, onUpdate: NoAction, map: "fk_47_1")
crm_notes crm_notes[]
crm_tasks crm_tasks[]
@@index([id_crm_user], map: "crm_deal_crm_userid")
@@index([id_crm_deals_stage], map: "crm_deal_deal_stageid")
@@index([id_crm_company], map: "fk_crm_deal_crmcompanyid")
}

model crm_deals_stages {
Expand Down Expand Up @@ -365,6 +369,7 @@ model projects {
id_organization String @db.Uuid
sync_mode String
pull_frequency BigInt?
redirect_url String?
api_keys api_keys[]
connections connections[]
linked_users linked_users[]
Expand Down Expand Up @@ -528,7 +533,7 @@ model tcg_users {
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
model users {
id_user String @id(map: "pk_users") @db.Uuid
email String @unique
email String
password_hash String
first_name String
last_name String
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/@core/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class AuthService {

async register(user: CreateUserDto) {
try {
const foundUser = await this.prisma.users.findUnique({
const foundUser = await this.prisma.users.findFirst({
where: { email: user.email },
});

Expand Down Expand Up @@ -99,7 +99,7 @@ export class AuthService {
}

if (!foundUser && user.email) {
foundUser = await this.prisma.users.findUnique({
foundUser = await this.prisma.users.findFirst({
where: { email: user.email },
});
}
Expand Down

0 comments on commit 083498e

Please sign in to comment.