Skip to content

Commit 744a40b

Browse files
committed
Final updates to the index page
1 parent 806b235 commit 744a40b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

example/next-storage/pages/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Auth from '../components/Auth'
44
import UploadButton from '../components/UploadButton'
55
import Avatar from '../components/Avatar'
66
import styles from '../styles/Home.module.css'
7-
import { AuthUser, AuthSession } from '../../../dist/main'
7+
import { AuthSession } from '../../../dist/main'
88
import { DEFAULT_AVATARS_BUCKET } from '../lib/constants'
99

1010
type Profile = {
@@ -119,17 +119,19 @@ export default function Home() {
119119

120120
const user = supabase.auth.user()
121121

122-
let { data: profile, error } = await supabase.from('profiles').upsert({
122+
const updates = {
123123
id: user.id,
124124
username,
125125
dob,
126+
}
127+
128+
let { error } = await supabase.from('profiles').upsert(updates, {
129+
returning: 'minimal', // Don't return the value after inserting
126130
})
127131

128132
if (error) {
129133
throw error
130134
}
131-
132-
setProfile(profile)
133135
} catch (error) {
134136
console.log('error', error.message)
135137
}

0 commit comments

Comments
 (0)