mirror of
https://github.com/logto-io/logto.git
synced 2025-01-27 21:39:16 -05:00
refactor(console): connector config should be required
This commit is contained in:
parent
23a1fe3aff
commit
bba2414104
2 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ type Props = {
|
|||
|
||||
const ConnectorContent = ({ isDeleted, connectorData, onConnectorUpdated }: Props) => {
|
||||
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
|
||||
const [config, setConfig] = useState<string>();
|
||||
const [config, setConfig] = useState('');
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
const api = useApi();
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import * as styles from './index.module.scss';
|
|||
type Props = {
|
||||
connectorId: string;
|
||||
connectorType: Exclude<ConnectorType, ConnectorType.Social>;
|
||||
config?: string;
|
||||
config: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
|
@ -58,7 +58,7 @@ const SenderTester = ({ connectorId, connectorType, config, className }: Props)
|
|||
const { sendTo } = formData;
|
||||
|
||||
try {
|
||||
const configJson = config ? (JSON.parse(config) as JSON) : undefined;
|
||||
const configJson = JSON.parse(config) as JSON;
|
||||
const data = { config: configJson, ...(isSms ? { phone: sendTo } : { email: sendTo }) };
|
||||
|
||||
await api
|
||||
|
|
Loading…
Add table
Reference in a new issue