summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/schema/users.ts3
-rw-r--r--lib/users/service.ts2
-rw-r--r--lib/users/verifyOtp.ts3
3 files changed, 8 insertions, 0 deletions
diff --git a/db/schema/users.ts b/db/schema/users.ts
index 8346c24b..2a1e45d6 100644
--- a/db/schema/users.ts
+++ b/db/schema/users.ts
@@ -1,6 +1,7 @@
import { integer, pgTable, varchar,timestamp,pgEnum ,pgView, text, primaryKey} from "drizzle-orm/pg-core";
import { eq , sql} from "drizzle-orm";
import { vendors } from "./vendors";
+import { techVendors } from "./techVendors";
export const userDomainEnum = pgEnum("user_domain", ["evcp", "partners"]);
@@ -11,6 +12,8 @@ export const users = pgTable("users", {
email: varchar("email", { length: 255 }).notNull().unique(),
companyId: integer("company_id")
.references(() => vendors.id, { onDelete: "set null" }),
+ techCompanyId: integer("tech_company_id")
+ .references(() => techVendors.id, { onDelete: "set null" }),
domain: userDomainEnum("domain").notNull().default("partners"),
createdAt: timestamp("created_at", { withTimezone: true })
.defaultNow()
diff --git a/lib/users/service.ts b/lib/users/service.ts
index 8b2c927e..0d0121b3 100644
--- a/lib/users/service.ts
+++ b/lib/users/service.ts
@@ -192,6 +192,7 @@ export async function findEmailandOtp(email: string, code: string) {
id: userRecord.id, // user id
imageUrl:userRecord.imageUrl,
companyId:userRecord.companyId,
+ techCompanyId:userRecord.techCompanyId,
domain:userRecord.domain
// 기타 필요한 필드...
}
@@ -218,6 +219,7 @@ export async function findEmailTemp(email: string) {
id: userRecord.id, // user id
imageUrl:userRecord.imageUrl,
companyId:userRecord.companyId,
+ techCompanyId:userRecord.techCompanyId,
domain:userRecord.domain
// 기타 필요한 필드...
}
diff --git a/lib/users/verifyOtp.ts b/lib/users/verifyOtp.ts
index 84919024..7b25ed49 100644
--- a/lib/users/verifyOtp.ts
+++ b/lib/users/verifyOtp.ts
@@ -23,6 +23,7 @@ export async function verifyOtp(email: string, code: string) {
id: otpRecord.id,
imageUrl: otpRecord.imageUrl,
companyId: otpRecord.companyId,
+ techCompanyId: otpRecord.techCompanyId,
domain: otpRecord.domain,
}
}
@@ -44,6 +45,7 @@ export async function verifyOtpTemp(email: string) {
id: otpRecord.id,
imageUrl: otpRecord.imageUrl,
companyId: otpRecord.companyId,
+ techCompanyId: otpRecord.techCompanyId,
domain: otpRecord.domain,
}
}
@@ -70,6 +72,7 @@ export async function verifyExternalCredentials(username: string, password: stri
id: otpRecord.id,
imageUrl: otpRecord.imageUrl,
companyId: otpRecord.companyId,
+ techCompanyId: otpRecord.techCompanyId,
domain: otpRecord.domain,
}
}