mirror of
https://github.com/supabase/supabase.git
synced 2026-10-14 05:39:11 +03:00
onsave props
This commit is contained in:
1 parent
240f16a778
commit
2ef8411f7e
1 file changed
+3
-8
@@ -64,7 +64,7 @@ interface EditorPanelProps {
|
||||
label?: string
|
||||
saveLabel?: string
|
||||
saveValue?: string
|
||||
onSave?: (value: string) => void
|
||||
onSave?: (value: string, saveValue: string) => void
|
||||
onRunSuccess?: (value: any[]) => void
|
||||
onRunError?: (value: any) => void
|
||||
functionName?: string
|
||||
@@ -404,7 +404,7 @@ export const EditorPanel = ({
|
||||
<Form_Shadcn_ {...saveForm}>
|
||||
<form
|
||||
onSubmit={saveForm.handleSubmit((values) => {
|
||||
onSave(values.saveValue)
|
||||
onSave(currentValue, values.saveValue)
|
||||
})}
|
||||
className="flex items-center gap-2"
|
||||
>
|
||||
@@ -417,12 +417,7 @@ export const EditorPanel = ({
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
size="tiny"
|
||||
type="default"
|
||||
htmlType="submit"
|
||||
disabled={!saveForm.formState.isDirty}
|
||||
>
|
||||
<Button size="tiny" type="default" htmlType="submit">
|
||||
{saveLabel}
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
Reference in new issue
Block a user