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:
parent
4ccd6b836e
commit
14143415f0
2 changed files with 7 additions and 1 deletions
5
.changeset-staged/pretty-hounds-sneeze.md
Normal file
5
.changeset-staged/pretty-hounds-sneeze.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@logto/console": patch
|
||||
---
|
||||
|
||||
Fix connector config form's validation for "switch" field.
|
|
@ -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) =>
|
||||
|
|
Loading…
Add table
Reference in a new issue