Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Reset state and set enable form actions for add role sidebar. (#20840)

Santosh Pisiniab42f99be028
diff --git a/apps/studio/components/interfaces/Database/Roles/CreateRolePanel.tsx b/apps/studio/components/interfaces/Database/Roles/CreateRolePanel.tsx
index 64d3c815fc2..3fc02a62cc7 100644
--- a/apps/studio/components/interfaces/Database/Roles/CreateRolePanel.tsx
+++ b/apps/studio/components/interfaces/Database/Roles/CreateRolePanel.tsx
@@ -56,7 +56,7 @@ const CreateRolePanel = ({ visible, onClose }: CreateRolePanelProps) => {
const { mutate: createDatabaseRole, isLoading: isCreating } = useDatabaseRoleCreateMutation({
onSuccess: (res) => {
toast.success(`Successfully created new role: ${res.name}`)
- onClose()
+ handleClose()
},
})
@@ -71,7 +71,7 @@ const CreateRolePanel = ({ visible, onClose }: CreateRolePanelProps) => {
const handleClose = () => {
onClose()
- form.reset()
+ form.reset(initialValues)
}
return (
@@ -88,7 +88,7 @@ const CreateRolePanel = ({ visible, onClose }: CreateRolePanelProps) => {
form={formId}
isSubmitting={isCreating}
hasChanges={form.formState.isDirty}
- handleReset={() => form.reset()}
+ handleReset={handleClose}
/>
</div>
}