mirror of
https://github.com/logto-io/logto.git
synced 2025-02-17 22:04:19 -05:00
fix(console): fix connector post/patch error rendering (#4274)
This commit is contained in:
parent
5c7018062a
commit
263ea256b9
2 changed files with 6 additions and 6 deletions
|
@ -1,6 +1,5 @@
|
|||
import type { ConnectorConfigFormItem } from '@logto/connector-kit';
|
||||
import { ConnectorConfigFormItemType } from '@logto/connector-kit';
|
||||
import { conditional } from '@silverhand/essentials';
|
||||
import { useMemo } from 'react';
|
||||
import { Controller, useFormContext } from 'react-hook-form';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
@ -49,10 +48,11 @@ function ConfigFormFields({ formItems }: Props) {
|
|||
}, [formItems, values]);
|
||||
|
||||
const renderFormItem = (item: ConnectorConfigFormItem) => {
|
||||
const error = conditional(
|
||||
formConfigErrors &&
|
||||
(formConfigErrors[item.key]?.message ?? Boolean(formConfigErrors[item.key]))
|
||||
);
|
||||
const errorMessage = formConfigErrors?.[item.key]?.message;
|
||||
const error =
|
||||
typeof errorMessage === 'string' && errorMessage.length > 0
|
||||
? errorMessage
|
||||
: Boolean(formConfigErrors?.[item.key]);
|
||||
|
||||
const buildCommonProperties = () => ({
|
||||
...register(`formConfig.${item.key}`, {
|
||||
|
|
|
@ -43,7 +43,7 @@ type Props = {
|
|||
};
|
||||
|
||||
function Guide({ connector, onClose }: Props) {
|
||||
const { createConnector } = useConnectorApi({ hideErrorToast: true });
|
||||
const { createConnector } = useConnectorApi();
|
||||
const { navigate } = useTenantPathname();
|
||||
const callbackConnectorId = useRef(generateStandardId());
|
||||
const [conflictConnectorName, setConflictConnectorName] = useState<Record<string, string>>();
|
||||
|
|
Loading…
Add table
Reference in a new issue