filter mid 수정

This commit is contained in:
focp212@naver.com
2025-10-30 10:18:00 +09:00
parent 04fc07cfe5
commit 51f8079b9a
10 changed files with 66 additions and 36 deletions

View File

@@ -17,7 +17,9 @@ export interface UserInfoState {
setUserMids: (update: SetStateAction<Array<string>>) => void;
setUserEmails: (update: SetStateAction<Array<string>>) => void;
selectOptionsMids: Array<Record<string, string>>;
selectOptionsMidsWithoutGids: Array<Record<string, string>>;
setSelectOptionsMids: (update: SetStateAction<Array<Record<string, string>>>) => void;
setSelectOptionsMidsWithoutGids: (update: SetStateAction<Array<Record<string, string>>>) => void;
selectOptionsEmails: Array<Record<string, string>>;
setSelectOptionsEmails: (update: SetStateAction<Array<Record<string, string>>>) => void;
mid: string;
@@ -35,6 +37,7 @@ const initialUserInfoState = {
userMids: [] as Array<string>,
userEmails: [] as Array<string>,
selectOptionsMids: [] as Array<Record<string, string>>,
selectOptionsMidsWithoutGids: [] as Array<Record<string, string>>,
selectOptionsEmails: [] as Array<Record<string, string>>,
mid: '' as string,
email: '' as string,
@@ -131,6 +134,18 @@ export const createUserInfoStore = lens<UserInfoState>((set, get) => ({
};
});
},
setSelectOptionsMidsWithoutGids: (update) => {
set((state: UserInfoState) => {
const newSelectOptionsMidsWithoutGids = (typeof update === 'function')
? update(state.selectOptionsMidsWithoutGids): update;
return {
...state,
selectOptionsMidsWithoutGids: [
...newSelectOptionsMidsWithoutGids
],
};
});
},
setSelectOptionsEmails: (update) => {
set((state: UserInfoState) => {
const newSelectOptionsEmails = (typeof update === 'function')