-부가서비스 MID 기준 SelectBox 처리 (추후 수정 가능)
- SMS 재발송 API 수정
This commit is contained in:
@@ -26,9 +26,10 @@ import { snackBar } from '@/shared/lib';
|
||||
|
||||
export const AlimtalkSettingPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const midOptionsWithoutGids = useStore.getState().UserStore.selectOptionsMidsWithoutGids;
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
|
||||
const [mid, setMid] = useState<string>(userMid);
|
||||
const [mid, setMid] = useState<string>('');
|
||||
|
||||
const [merchantCardApprovalFlag, setMerchantCardApprovalFlag] = useState<boolean>(false);
|
||||
const [merchantCardCancelFlag, setMerchantCardCancelFlag] = useState<boolean>(false);
|
||||
@@ -122,9 +123,24 @@ export const AlimtalkSettingPage = () => {
|
||||
callSettingSave();
|
||||
};
|
||||
|
||||
// MID 초기값 설정
|
||||
useEffect(() => {
|
||||
callSettingDetail();
|
||||
}, []);
|
||||
if (!mid && midOptionsWithoutGids.length > 0) {
|
||||
// userMid가 옵션에 있으면 userMid 사용, 없으면 첫 번째 옵션 사용
|
||||
const midItem = midOptionsWithoutGids.filter((value) => value.value === userMid);
|
||||
const initialMid = (midItem.length > 0) ? userMid : midOptionsWithoutGids[0]?.value || '';
|
||||
if (initialMid) {
|
||||
setMid(initialMid);
|
||||
}
|
||||
}
|
||||
}, [midOptionsWithoutGids, userMid]);
|
||||
|
||||
// mid가 설정되면 설정 정보 불러오기
|
||||
useEffect(() => {
|
||||
if (mid) {
|
||||
callSettingDetail();
|
||||
}
|
||||
}, [mid]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -141,8 +157,17 @@ export const AlimtalkSettingPage = () => {
|
||||
<div className="service-merchant">
|
||||
<div className="service-title">가맹점</div>
|
||||
<div className="service-select">
|
||||
<select>
|
||||
<option>nictest00m</option>
|
||||
<select
|
||||
value={mid}
|
||||
onChange={(e) => setMid(e.target.value)}>
|
||||
{
|
||||
midOptionsWithoutGids.map((value) => (
|
||||
<option
|
||||
key={value.value}
|
||||
value={value.value}
|
||||
>{value.name}</option>
|
||||
))
|
||||
}
|
||||
</select>
|
||||
<span className="ic20 arrow-down" aria-hidden="true"></span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user