Skip to content

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

Fix sharing of snippets.

Ivan Vasilov6a949554c51d
diff --git a/studio/state/sql-editor.ts b/studio/state/sql-editor.ts
index 03ca7ec32c6..0f16cdd6d4a 100644
--- a/studio/state/sql-editor.ts
+++ b/studio/state/sql-editor.ts
@@ -1,4 +1,4 @@
-import { UpsertContentPayload, upsertContent } from 'data/content/content-upsert-mutation'
+import { upsertContent, UpsertContentPayload } from 'data/content/content-upsert-mutation'
import { SqlSnippet } from 'data/content/sql-snippets-query'
import { debounce, memoize } from 'lodash'
import { useMemo } from 'react'
@@ -209,7 +209,7 @@ if (typeof window !== 'undefined') {
...snippet.snippet,
name: snippet.snippet.name ?? 'Untitled',
description: snippet.snippet.description ?? '',
- visibility: 'user',
+ visibility: snippet.snippet.visibility ?? 'user',
project_id: snippet.snippet.project_id ?? 0,
content: { ...snippet.snippet.content, content_id: id } as SqlSnippets.Content,
type: 'sql',