0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(console): rename id -> target in display connector (#1193)

This commit is contained in:
Xiao Yijun 2022-06-22 10:52:44 +08:00 committed by GitHub
parent 71ed416bde
commit deb4ec5f38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@ type Props = {
};
type DisplayConnector = {
id: string;
target: string;
userId?: string;
logo: string;
name: Record<Language, string>;
@ -65,7 +65,7 @@ const UserConnectors = ({ userId, connectors, onDelete }: Props) => {
'zh-CN': '未知连接器',
en: 'Unknown Connector',
},
id: key,
target: key,
userId: connectors[key]?.userId,
};
}
@ -75,7 +75,7 @@ const UserConnectors = ({ userId, connectors, onDelete }: Props) => {
return {
logo,
name,
id: key,
target: key,
userId: connectors[key]?.userId,
};
});
@ -111,10 +111,10 @@ const UserConnectors = ({ userId, connectors, onDelete }: Props) => {
/>
)}
{displayConnectors.map((connector) => {
const { id, userId = '', name, logo } = connector;
const { target, userId = '', name, logo } = connector;
return (
<tr key={id}>
<tr key={target}>
<td>
<div className={styles.connectorName}>
<img src={logo} />
@ -150,7 +150,7 @@ const UserConnectors = ({ userId, connectors, onDelete }: Props) => {
}}
onConfirm={async () => {
if (deletingConnector !== undefined) {
await handleDelete(deletingConnector.id);
await handleDelete(deletingConnector.target);
setDeletingConnector(undefined);
}
}}