mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 01:45:10 +03:00
Minor fixes in _app.js (Slack clone)
This commit is contained in:
1 parent
6b8e794fa2
commit
61f26b0386
1 file changed
+2
-2
@@ -38,12 +38,12 @@ export default function SupabaseSlackClone({Component, pageProps}){
|
||||
}, [user])
|
||||
|
||||
const signIn = async (id, username) => {
|
||||
let { body } = await supabase.from('users').select('id, username').eq('id', id)
|
||||
const { body } = await supabase.from('users').select('id, username').eq('id', id)
|
||||
const result = body[0]
|
||||
|
||||
// If the user exists in the users table, update the username.
|
||||
// If not, create a new row.
|
||||
let { body2 } = result?.id
|
||||
result?.id
|
||||
? await supabase.from('users').update({ id, username }).match({ id }).single()
|
||||
: await supabase.from('users').insert([{ id, username }]).single()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user