0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-17 22:04:19 -05:00

Merge pull request #1538 from logto-io/charles-connector-config-should-be-required

refactor(console): connector config should be required
This commit is contained in:
Charles Zhao 2022-07-14 01:28:16 +08:00 committed by GitHub
commit 52159566e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ type Props = {
const ConnectorContent = ({ isDeleted, connectorData, onConnectorUpdated }: Props) => { const ConnectorContent = ({ isDeleted, connectorData, onConnectorUpdated }: Props) => {
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
const [config, setConfig] = useState<string>(); const [config, setConfig] = useState('');
const [isSubmitting, setIsSubmitting] = useState(false); const [isSubmitting, setIsSubmitting] = useState(false);
const api = useApi(); const api = useApi();

View file

@ -17,7 +17,7 @@ import * as styles from './index.module.scss';
type Props = { type Props = {
connectorId: string; connectorId: string;
connectorType: Exclude<ConnectorType, ConnectorType.Social>; connectorType: Exclude<ConnectorType, ConnectorType.Social>;
config?: string; config: string;
className?: string; className?: string;
}; };
@ -58,7 +58,7 @@ const SenderTester = ({ connectorId, connectorType, config, className }: Props)
const { sendTo } = formData; const { sendTo } = formData;
try { 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 }) }; const data = { config: configJson, ...(isSms ? { phone: sendTo } : { email: sendTo }) };
await api await api