공통코드
This commit is contained in:
@@ -10,6 +10,12 @@ export interface BannerInfoState {
|
||||
export interface CommonState {
|
||||
serviceCodes: Array<any>;
|
||||
setServiceCodes: (update: SetStateAction<Array<any>>) => void;
|
||||
creditCardList: Array<any>;
|
||||
setCreditCardList: (update: SetStateAction<Array<any>>) => void;
|
||||
bankList: Array<any>;
|
||||
setBankList: (update: SetStateAction<Array<any>>) => void;
|
||||
virtualBankList: Array<any>;
|
||||
setVirtualBankList: (update: SetStateAction<Array<any>>) => void;
|
||||
};
|
||||
|
||||
const initialBannerInfoState = {
|
||||
@@ -51,5 +57,41 @@ export const createCommonStore = lens<CommonState>((set, get) => ({
|
||||
]
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
setCreditCardList: (update) => {
|
||||
set((state: CommonState) => {
|
||||
const newCreditCardList = (typeof update === 'function')
|
||||
? update(state.creditCardList): update;
|
||||
return {
|
||||
...state,
|
||||
creditCardList: [
|
||||
...newCreditCardList
|
||||
]
|
||||
};
|
||||
});
|
||||
},
|
||||
setBankList: (update) => {
|
||||
set((state: CommonState) => {
|
||||
const newBankList = (typeof update === 'function')
|
||||
? update(state.bankList): update;
|
||||
return {
|
||||
...state,
|
||||
bankList: [
|
||||
...newBankList
|
||||
]
|
||||
};
|
||||
});
|
||||
},
|
||||
setVirtualBankList: (update) => {
|
||||
set((state: CommonState) => {
|
||||
const newVirtualBankList = (typeof update === 'function')
|
||||
? update(state.virtualBankList): update;
|
||||
return {
|
||||
...state,
|
||||
virtualBankList: [
|
||||
...newVirtualBankList
|
||||
]
|
||||
};
|
||||
});
|
||||
},
|
||||
}));
|
||||
|
||||
@@ -98,7 +98,7 @@ export interface CodesSelectParams {
|
||||
colNm?: string;
|
||||
code1?: string;
|
||||
code2?: string;
|
||||
useCl?: string;
|
||||
useCl?: number;
|
||||
method: 'get' | 'post';
|
||||
};
|
||||
export interface CodeListItem {
|
||||
|
||||
Reference in New Issue
Block a user