Chris_Acrobat
04/03/2022, 5:48 PMJavaScript
console.log((await req.text()).length)
And from curl I get a valid number, but from fetch I get 0. Can anyone see/say what I am doing wrong in my fetch request?
JavaScript
fetch(new Request('https://_exeample_.functions.supabase.co/login'), {
method: 'POST',
headers: new Headers({
'Content-Type': 'application/json',
'Authorization': 'Bearer anon-key-from-https://app.supabase.io/project/_exeample_'
}),
body: JSON.stringify({
a: "A",
b: "B"
})
})
Pete | grid0.xyz
04/04/2022, 12:10 AMPete | grid0.xyz
04/04/2022, 12:10 AMconst { user, session, error:signUpError } = await supabase.auth.signUp({
email: formData.email,
password: formData.password,
})
if (signUpError) {
throw signUpError
}
const { data, error } = await supabase
.from('profiles')
.update({ username: formData.userName })
.eq('id', user.id)
silentworks
04/04/2022, 12:20 AMzavbala
04/04/2022, 6:23 PMsilas
04/04/2022, 8:51 PMPete | grid0.xyz
04/04/2022, 10:04 PMconst { user, error } = await supabase.auth.update({email: 'new@email.com'})
I have a profile page, where users can update their profile info. I'm able to update the data in the public 'profiles' table, but when I try to update the email for the auth table, nothing happens.garyaustin
04/04/2022, 10:28 PMZenon
04/06/2022, 6:23 PMZenon
04/06/2022, 6:24 PMgaryaustin
04/06/2022, 7:24 PMeMeRiKa
04/07/2022, 10:58 AMto_timestamp(xxxx)
What is the best way to do that? It doesn't seem to work with
const { data, error } = await supabase.from("posts")
.select('*')
.gt('to_timestamp(date_start, \'YYYY-MM-DD\')', dateStart.getTime())
.lt('to_timestamp(date_end, \'YYYY-MM-DD\')', dateEnd.getTime());
fernandolguevara
04/07/2022, 11:31 AMfernandolguevara
04/07/2022, 11:32 AMjs
const { data, error } = await supabase
.from('users')
.select(`
id, name,
address->street
`)
.eq('address->postcode', 90210)
fernandolguevara
04/07/2022, 11:35 AMnew Date('XXXXX').toISOString()
on javascripteMeRiKa
04/07/2022, 1:06 PMeMeRiKa
04/07/2022, 1:07 PMSELECT * FROM posts WHERE to_timestamp(date_start, 'YYYY-MM-DD') > NOW() AND to_timestamp(date_end, 'YYYY-MM-DD') < XXXX
eMeRiKa
04/07/2022, 1:09 PMeMeRiKa
04/07/2022, 1:47 PMconst { data, error } = await supabase.from("posts")
.select('*')
.gte('date_start', dateStart.toISOString())
.lte('date_end', dateEnd.toISOString())
fernandolguevara
04/07/2022, 1:59 PMfernandolguevara
04/07/2022, 1:59 PMhonkstyle
04/07/2022, 4:55 PM<RequireAuth>
(navigates to /login
if not logged in) component for my routes. My goal is that when a user logs out, they get sent to "/"
. What actually happens is user is first navigated to /login
and then to /
.Yeehawlerz101
04/07/2022, 5:11 PMAbnormal
04/07/2022, 7:39 PMMuezz
04/07/2022, 7:41 PMcreated_at
(you obviously need to have that column) and then limit the query result.Muezz
04/07/2022, 7:41 PMMuezz
04/07/2022, 7:42 PMnow()
as default valueAbnormal
04/07/2022, 7:43 PMAbnormal
04/07/2022, 7:43 PM