0
Fork 0
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:
Charles Zhao 2022-07-14 01:13:26 +08:00
parent 23a1fe3aff
commit bba2414104
No known key found for this signature in database
GPG key ID: 4858774754C92DF2
2 changed files with 3 additions and 3 deletions

View file

@ -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();

View file

@ -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