From 0c5a4bb2fbb10aa488e302d941035ead28408404 Mon Sep 17 00:00:00 2001 From: Inian Date: Fri, 19 Aug 2022 12:57:15 +0800 Subject: [PATCH] add in generated files --- .../_supabase_js/generated/auth-getuser.mdx | 12 +++++++++--- .../_supabase_js/generated/subscribe.mdx | 18 +++++++++--------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/apps/reference/_supabase_js/generated/auth-getuser.mdx b/apps/reference/_supabase_js/generated/auth-getuser.mdx index cce9bb30d63..a9c49d269e6 100644 --- a/apps/reference/_supabase_js/generated/auth-getuser.mdx +++ b/apps/reference/_supabase_js/generated/auth-getuser.mdx @@ -11,7 +11,9 @@ import TabItem from '@theme/TabItem' Gets the current user details if there is an existing session. ```js -const user = await supabase.auth.getUser() +const { + data: { user }, +} = await supabase.auth.getUser() ``` ## Parameters @@ -50,11 +52,15 @@ Takes in an optional access token jwt. If no jwt is provided, getUser() will att ### Get the logged in user with the current existing session ```js -const user = await supabase.auth.getUser() +const { + data: { user }, +} = await supabase.auth.getUser() ``` ### Get the logged in user with a custom access token jwt. ```js -const user = supabase.auth.getUser(jwt) +const { + data: { user }, +} = await supabase.auth.getUser(jwt) ``` diff --git a/apps/reference/_supabase_js/generated/subscribe.mdx b/apps/reference/_supabase_js/generated/subscribe.mdx index 346bd7632c7..c78f6362474 100644 --- a/apps/reference/_supabase_js/generated/subscribe.mdx +++ b/apps/reference/_supabase_js/generated/subscribe.mdx @@ -9,7 +9,7 @@ import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' ```js -const myChannel = supabase +supabase .channel('*') .on('postgres_changes', { event: '*', schema: '*' }, (payload) => { console.log('Change received!', payload) @@ -89,14 +89,14 @@ A callback function that will be called when the channel receives a message. - Row level security is not applied to delete statements. - If you want to receive the "previous" data for updates and deletes, you will need to set `REPLICA IDENTITY` to `FULL`, like this: `ALTER TABLE your_table REPLICA IDENTITY FULL;` - When a delete occurs, the contents of old_record will be broadcast to all subscribers to that table so ensure that each table's replica identity only contains information that is safe to expose publicly. -- The channel name must exactly match the schema/table/filter you want to listen to separated by semicolons. See below examples for additional context. +- The channel name must exactly match the schema/table/filter you want to listen to separated by colons. See below examples for additional context. ## Examples ### Listen to all database changes ```js -const myChannel = supabase +supabase .channel('*') .on('postgres_changes', { event: '*', schema: '*' }, (payload) => { console.log('Change received!', payload) @@ -107,7 +107,7 @@ const myChannel = supabase ### Listening to a specific table ```js -const myChannel = supabase +supabase .channel('public:countries') .on( 'postgres_changes', @@ -122,7 +122,7 @@ const myChannel = supabase ### Listening to inserts ```js -const myChannel = supabase +supabase .channel('public:countries') .on( 'postgres_changes', @@ -144,7 +144,7 @@ alter table "your_table" replica identity full; ``` ```js -const myChannel = supabase +supabase .channel('public:countries') .on( 'postgres_changes', @@ -166,7 +166,7 @@ alter table "your_table" replica identity full; ``` ```js -const myChannel = supabase +supabase .channel('public:countries') .on( 'postgres_changes', @@ -183,7 +183,7 @@ const myChannel = supabase You can chain listeners if you want to listen to multiple events for each table. ```js -const myChannel = supabase +supabase .channel('public:countries') .on( 'postgres_changes', @@ -203,7 +203,7 @@ const myChannel = supabase You can listen to individual rows using the format `{table}:{col}=eq.{val}` - where `{col}` is the column name, and `{val}` is the value which you want to match. ```js -const myChannel = supabase +supabase .channel('public:countries:id=eq.200') .on( 'postgres_changes',