refactor: add formattedData in IConnection references
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
719a948134
commit
6a8ec97c31
@@ -21,12 +21,12 @@ type ChooseAccountSubstepProps = {
|
||||
step: IStep;
|
||||
};
|
||||
|
||||
const optionGenerator = (connection: IConnection<IJSONObject>): { label: string; value: string; } => ({
|
||||
label: connection?.data?.screenName as string ?? 'Unnamed',
|
||||
const optionGenerator = (connection: IConnection): { label: string; value: string; } => ({
|
||||
label: connection?.formattedData?.screenName as string ?? 'Unnamed',
|
||||
value: connection?.id as string,
|
||||
});
|
||||
|
||||
const getOption = (options: Record<string, unknown>[], connectionId: string) => options.find(connection => connection.value === connectionId) || null;
|
||||
const getOption = (options: Record<string, unknown>[], connectionId?: string) => options.find(connection => connection.value === connectionId) || null;
|
||||
|
||||
function ChooseAccountSubstep(props: ChooseAccountSubstepProps): React.ReactElement {
|
||||
const {
|
||||
|
Reference in New Issue
Block a user