File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
example/next-storage/pages Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import Auth from '../components/Auth'
4
4
import UploadButton from '../components/UploadButton'
5
5
import Avatar from '../components/Avatar'
6
6
import styles from '../styles/Home.module.css'
7
- import { AuthUser , AuthSession } from '../../../dist/main'
7
+ import { AuthSession } from '../../../dist/main'
8
8
import { DEFAULT_AVATARS_BUCKET } from '../lib/constants'
9
9
10
10
type Profile = {
@@ -119,17 +119,19 @@ export default function Home() {
119
119
120
120
const user = supabase . auth . user ( )
121
121
122
- let { data : profile , error } = await supabase . from ( 'profiles' ) . upsert ( {
122
+ const updates = {
123
123
id : user . id ,
124
124
username,
125
125
dob,
126
+ }
127
+
128
+ let { error } = await supabase . from ( 'profiles' ) . upsert ( updates , {
129
+ returning : 'minimal' , // Don't return the value after inserting
126
130
} )
127
131
128
132
if ( error ) {
129
133
throw error
130
134
}
131
-
132
- setProfile ( profile )
133
135
} catch ( error ) {
134
136
console . log ( 'error' , error . message )
135
137
}
You can’t perform that action at this time.
0 commit comments