0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-27 21:39:16 -05:00

fix(console): fix connector form validation for switch (#3617)

This commit is contained in:
wangsijie 2023-03-28 11:09:02 +08:00 committed by GitHub
parent 4ccd6b836e
commit 14143415f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"@logto/console": patch
---
Fix connector config form's validation for "switch" field.

View file

@ -73,7 +73,8 @@ function ConfigForm({ formItems }: Props) {
name={item.key}
control={control}
rules={{
required: item.required,
// For switch, "false" will be treated as an empty value, so we need to set required to false.
required: item.type === ConnectorConfigFormItemType.Switch ? false : item.required,
validate:
item.type === ConnectorConfigFormItemType.Json
? (value) =>