Skip to content

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

Chore/reverse edit logic (#23649)

Terry Sutton3ec218e82760
diff --git a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/LockedQuerySection.tsx b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/LockedQuerySection.tsx
index 224a8499203..429de771a3e 100644
--- a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/LockedQuerySection.tsx
+++ b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/LockedQuerySection.tsx
@@ -38,15 +38,15 @@ export const LockedCreateQuerySection = ({
Use options above to edit
</p>
</div>
- <Button
+ {/* <Button
type="default"
onClick={() => {
const query = isEditing
- ? generateCreatePolicyQuery({
- name,
+ ? generateAlterPolicyQuery({
+ name: '',
+ newName: name,
schema,
table,
- behavior,
command,
roles: roles.length === 0 ? 'public' : roles,
using: (editorOneRef.current?.getValue() ?? undefined)?.trim(),
@@ -55,11 +55,11 @@ export const LockedCreateQuerySection = ({
? (editorOneRef.current?.getValue() ?? undefined)?.trim()
: (editorTwoRef.current?.getValue() ?? undefined)?.trim(),
})
- : generateAlterPolicyQuery({
- name: '',
- newName: name,
+ : generateCreatePolicyQuery({
+ name,
schema,
table,
+ behavior,
command,
roles: roles.length === 0 ? 'public' : roles,
using: (editorOneRef.current?.getValue() ?? undefined)?.trim(),
@@ -72,7 +72,7 @@ export const LockedCreateQuerySection = ({
}}
>
Open in SQL Editor
- </Button>
+ </Button> */}
</div>
<div className="flex items-start" style={{ fontSize: '14px' }}>
<p className="px-6 font-mono text-sm text-foreground-light select-none">1</p>