Skip to content

Commit

Permalink
DASG-602: select account profiles default
Browse files Browse the repository at this point in the history
  • Loading branch information
ilkinguluzada authored and trukhilio committed May 3, 2023
1 parent 7f2786c commit a31bf15
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion client/src/pages/AdminPartnersListPage/AdminPartnersListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
REF_PROFILE_TYPE,
REF_PROFILE_TYPES_FILTER_OPTIONS,
} from '../../constants/common';
import { FIO_ACCOUNT_TYPES } from '../../constants/fio';
import { DEFAULT_LIMIT } from '../../hooks/usePagination';

import useEffectOnce from '../../hooks/general';
Expand All @@ -32,6 +33,7 @@ const AdminPartnersListPage: React.FC<Props> = props => {
getFioAccountsProfilesList,
getPartnersList,
} = props;

const [filters, setFilters] = useState<Partial<RefProfile>>({ type: '' });
const [showPartnerModal, setShowPartnerModal] = useState<boolean>(false);
const [selectedPartner, setSelectedPartner] = useState<Partial<RefProfile>>(
Expand Down Expand Up @@ -73,9 +75,17 @@ const AdminPartnersListPage: React.FC<Props> = props => {
img: '',
link: '',
},
freeFioAccountProfileId: fioAccountsProfilesList.find(
fioAccountsProfile =>
fioAccountsProfile.accountType === FIO_ACCOUNT_TYPES.FREE,
)?.id,
paidFioAccountProfileId: fioAccountsProfilesList.find(
fioAccountsProfile =>
fioAccountsProfile.accountType === FIO_ACCOUNT_TYPES.PAID,
)?.id,
});
setShowPartnerModal(true);
}, []);
}, [fioAccountsProfilesList]);
const onEditPartner = useCallback((partner: RefProfile) => {
setSelectedPartner(partner);
setShowPartnerModal(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export const PartnerFormComponent: React.FC<FormRenderProps<RefProfile> & {
uiType={INPUT_UI_STYLES.BLACK_WHITE}
errorColor={COLOR_TYPE.WARN}
label="FIO Account Profile for Free Registrations *"
placeholder="FIO Account Profie FREE"
placeholder="Select..."
loading={validating}
disabled={submitting || loading}
/>
Expand All @@ -249,7 +249,7 @@ export const PartnerFormComponent: React.FC<FormRenderProps<RefProfile> & {
uiType={INPUT_UI_STYLES.BLACK_WHITE}
errorColor={COLOR_TYPE.WARN}
label="FIO Account Profile for Paid Registrations *"
placeholder="FIO Account Profie PAID"
placeholder="Select..."
loading={validating}
disabled={submitting || loading}
/>
Expand Down
4 changes: 2 additions & 2 deletions client/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ export type RefProfile = {
link?: string;
};
tpid: string;
freeFioAccountProfileId: number;
paidFioAccountProfileId: number;
freeFioAccountProfileId: string;
paidFioAccountProfileId: string;
createdAt?: string;
};

Expand Down

0 comments on commit a31bf15

Please sign in to comment.