mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
Fix query block read only catch (#35543)
* Fix query block read only catch * Update apps/studio/components/ui/QueryBlock/QueryBlock.tsx Co-authored-by: Alaister Young <alaister@users.noreply.github.com> --------- Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
This commit is contained in:
1 parent
fe60571754
commit
ff3832a659
1 file changed
+6
-1
@@ -167,9 +167,14 @@ export const QueryBlock = ({
|
||||
onSuccess: (data) => {
|
||||
onResults?.(data.result)
|
||||
setQueryResult(data.result)
|
||||
|
||||
setReadOnlyError(false)
|
||||
setQueryError(undefined)
|
||||
},
|
||||
onError: (error) => {
|
||||
if (error?.message.includes('permission denied')) {
|
||||
const permissionDenied = error.message.includes('permission denied')
|
||||
const notOwner = error.message.includes('must be owner')
|
||||
if (permissionDenied || notOwner) {
|
||||
setReadOnlyError(true)
|
||||
if (showRunButtonIfNotReadOnly) setShowWarning('hasWriteOperation')
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user