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:
commit
52159566e7
2 changed files with 3 additions and 3 deletions
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue