임동욱 임동욱 08-19
merge: 휴대전화 앞자리 선택 불가 수정
@dd3419119f604ec6011041c988349d7b8669ec46
app/(protected)/(basic)/admins/_components/admin-member-form-fields.tsx
--- app/(protected)/(basic)/admins/_components/admin-member-form-fields.tsx
+++ app/(protected)/(basic)/admins/_components/admin-member-form-fields.tsx
@@ -11,6 +11,7 @@
   ADMIN_ROLE_OPTIONS,
 } from '@/lib/domain/admin-member';
 import type { AdminMemberFormErrors } from '@/lib/domain/admin-member-form';
+import { MOBILE_PHONE_PREFIXES } from '@/lib/domain/phone-number';
 import styles from './admin-member-modal.module.scss';
 
 interface AdminMemberFormFieldsProps {
@@ -78,6 +79,8 @@
         </FoxFormLabel>
         <FoxPhoneNumber
           type="unit"
+          // 넘기지 않으면 앞자리 셀렉트가 빈 목록이라 아무것도 고를 수 없다(상수 주석 참조).
+          prefixOptions={[...MOBILE_PHONE_PREFIXES]}
           value={phoneNumber}
           onChange={onPhoneNumberChange}
           message={errors.phoneNumber}
lib/domain/phone-number.ts
--- lib/domain/phone-number.ts
+++ lib/domain/phone-number.ts
@@ -57,3 +57,19 @@
 
   return groups === null ? trimmed : groups.join('-');
 }
+
+/**
+ * 휴대전화 앞자리 목록 — `FoxPhoneNumber`의 앞자리 셀렉트에 넘긴다.
+ *
+ * **넘기지 않으면 그 셀렉트에 고를 것이 하나도 없다**(@fox의 기본값이 빈 배열이다). 그때도 칸에는
+ * placeholder "010"이 떠서 고른 것처럼 보이는데 값은 빈 문자열이라, 가운데·끝자리를 다 채워도
+ * 8자리만 제출돼 "휴대전화 번호를 정확히 입력해 주세요."로 막힌다.
+ */
+export const MOBILE_PHONE_PREFIXES: readonly string[] = [
+  '010',
+  '011',
+  '016',
+  '017',
+  '018',
+  '019',
+];
Add a comment
List