mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-11-02 01:15:31 +00:00
fix: bug with create role and unlimited visibility checkbox (#7088)
This commit is contained in:
1 parent
48c2c8567c
commit
e5eccb6227
1 file changed
+7
-5
@@ -45,18 +45,20 @@ export const AddRoleForm = ({
|
||||
},
|
||||
});
|
||||
|
||||
const manageProviders = form.watch("manage_providers");
|
||||
const unlimitedVisibility = form.watch("unlimited_visibility");
|
||||
const { watch, setValue } = form;
|
||||
|
||||
const manageProviders = watch("manage_providers");
|
||||
const unlimitedVisibility = watch("unlimited_visibility");
|
||||
|
||||
useEffect(() => {
|
||||
if (manageProviders) {
|
||||
form.setValue("unlimited_visibility", true, {
|
||||
if (manageProviders && !unlimitedVisibility) {
|
||||
setValue("unlimited_visibility", true, {
|
||||
shouldValidate: true,
|
||||
shouldDirty: true,
|
||||
shouldTouch: true,
|
||||
});
|
||||
}
|
||||
}, [manageProviders, form]);
|
||||
}, [manageProviders, unlimitedVisibility, setValue]);
|
||||
|
||||
const isLoading = form.formState.isSubmitting;
|
||||
|
||||
|
||||
Reference in new issue
Block a user