diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-15 14:41:01 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-15 14:41:01 +0000 |
| commit | 4ee8b24cfadf47452807fa2af801385ed60ab47c (patch) | |
| tree | e1d1fb029f0cf5519c517494bf9a545505c35700 /lib/users/repository.ts | |
| parent | 265859d691a01cdcaaf9154f93c38765bc34df06 (diff) | |
(대표님) 작업사항 - rfqLast, tbeLast, pdfTron, userAuth
Diffstat (limited to 'lib/users/repository.ts')
| -rw-r--r-- | lib/users/repository.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/users/repository.ts b/lib/users/repository.ts index 121a1eaa..46ee1e48 100644 --- a/lib/users/repository.ts +++ b/lib/users/repository.ts @@ -2,7 +2,7 @@ import db from '@/db/db'; import { users, otps, type User, Role, roles, userRoles } from '@/db/schema/users'; import { Otp } from '@/types/user'; -import { eq,and ,asc} from 'drizzle-orm'; +import { eq,and ,asc,sql} from 'drizzle-orm'; // 모든 사용자 조회 export const getAllUsers = async (): Promise<User[]> => { @@ -55,12 +55,13 @@ export const getUserByEmail = async ( ): Promise<User | null> => { const { includeInactive = false } = options - let whereCondition = eq(users.email, email) + let whereCondition = sql`LOWER(${users.email}) = LOWER(${email})` // 기본적으로 활성 사용자만 조회 if (!includeInactive) { whereCondition = and( - eq(users.email, email), + // eq(users.email, email), + sql`LOWER(${users.email}) = LOWER(${email})`, eq(users.isActive, true) )! } |
