가맹점관리

This commit is contained in:
focp212@naver.com
2025-10-01 10:51:18 +09:00
parent 68f8560d05
commit 1432b9d3c6
6 changed files with 59 additions and 75 deletions

View File

@@ -8,35 +8,51 @@ import {
MerchantMidParams,
MerchantMidResponse
} from '../model/types';
import { useStore } from '@/shared/model/store';
export const InfoWrap = () => {
const userMids = useStore.getState().UserStore.userMids;
const midOptions = useStore.getState().UserStore.selectOptionsMids;
const [mid, setMid] = useState<string>('nictest00m');
const [mid, setMid] = useState<string | undefined>(userMids[0]);
const [data, setData] = useState<MerchantMidResponse>();
const [openChild, setOpenChild] = useState<InfoWrapKeys | null>(null);
const { mutateAsync: merchantMid } = useMerchantMidMutation();
const callInfo = () => {
const callInfo = (selectedMid?: string) => {
let params: MerchantMidParams = {
mid: mid,
mid: selectedMid || mid
};
merchantMid(params).then((rs: MerchantMidResponse) => {
setData(rs);
});
};
const onChangeMid = (value: string) => {
setMid(value);
callInfo(value);
};
useEffect(() => {
// callInfo();
callInfo();
}, []);
return (
<>
<div className="input-wrapper top-select mt-30">
<select>
<option value="1">nicetest00g</option>
<option value="2">nicetest00g</option>
<option value="3">nicetest00g</option>
<select
onChange={ (e) => onChangeMid(e.target.value) }
>
{
midOptions.map((value, index) => (
<option
key={ value.value }
value={ value.value }
>{ value.name }</option>
))
}
</select>
</div>