diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-08-29 04:33:28 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-08-29 04:33:28 +0000 |
| commit | b917cb0d43b4b4524e931b75ff971e5620d52ac1 (patch) | |
| tree | 92e066b6b42b5766d1b5835251e6feb9c192971e /lib/users | |
| parent | 92ad8a740bfefa8c7465c23e41208a7e36caa59d (diff) | |
(최겸) user phone trim 추가
Diffstat (limited to 'lib/users')
| -rw-r--r-- | lib/users/repository.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/users/repository.ts b/lib/users/repository.ts index 093ef716..121a1eaa 100644 --- a/lib/users/repository.ts +++ b/lib/users/repository.ts @@ -102,6 +102,11 @@ export const createSAMLUser = async ( // 사용자 업데이트 export const updateUser = async (id: number, data: Partial<User>): Promise<User | null> => { + // 전화번호가 있는 경우 trim 처리 + if (data.phone !== undefined) { + data.phone = data.phone?.trim(); + } + const usersRes = await db.update(users).set(data).where(eq(users.id, id)).returning(); if (usersRes.length === 0) return null; const user = usersRes[0]; |
