Nostro
09/28/2022, 10:32 AMtheSimon
09/28/2022, 11:13 AM.from('challenges').select('*, profiles(id, username), categories(title, image_url)')
While I get the correct category data, the profile data is somehow wrong. For all 5 challenges i** get the same profile data**, even when 2 challenges are assigned (through the join table) to a different profile.
How could it be that the categories work fine, and an identical table & request does not?
Thanks for your help 🙂
Simonsofaking
09/28/2022, 11:48 AMczypnt
09/28/2022, 3:52 PMValdien
09/28/2022, 4:18 PMconst { error, user } = await supabase.auth.signUp(
{
email: data.email,
password: data.password,
},
{ data: { username: data.username, team: data.team },
captchaToken: captchaToken }
);
everything else is set up exactly as shown in the guide here: https://supabase.com/docs/guides/auth/auth-captcha
Sign ups work just fine with out captcha. Any suggestions? And yes..I have checked the secret key, several times=)SimonP
09/28/2022, 4:32 PMdb
09/28/2022, 4:43 PMJOCKER
09/28/2022, 6:06 PMLordKeebler
09/28/2022, 6:26 PMBoogersLLC
09/28/2022, 8:16 PMLayoutServerLoad
only pulls back the auth.user
as far as I understand. -- I want to grab additional properties like theme
so that I can have that user's theme during SSR.
LayoutServerLoad
blocks rendering the corresponding svelte layout/page until it completes. Wouldn't hitting the supabase API to grab profiles add to this time to finish?
i.e. I'm looking for a way to grab custom fields/columns from the user without having to make a second trip to the server.
More context, this is essentially what I'm trying to achieve:
ts
export const load: LayoutServerLoad = async ({ locals }) => {
// locals.session.user <-- Already has user's data.
return {
session: locals.session,
theme: 'night' // <-- Get user's theme from locals.session.user
};
};
Lukas V
09/28/2022, 8:19 PMsupabase
.from('recipes')
.select(
`*`,
{ count: 'exact' }
)
.limit(1)
.not('id', 'in', `(${fetchedRecipeIds})`);
10 queries would simply return results in this id sequence - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 correct?
As you can see from the picture first 4 results are recipes with tuna, which would result in bad UX for users who want to fetch recipes 1 by 1.
How can I make it random or at least group them so that I know that the next recipe user fetches won't be from the same "group".
Ideally result sequence would looks something like this:
Tuna..., chicken..., pizza..., tuna..., chicken and so forth...helena
09/28/2022, 8:48 PMconst { data, error, status } = await supabase
.from("user_apples")
.update({ // multiply by 0.5?? // })
.match({ name: "john" });
vjoohov
09/28/2022, 9:50 PMoliverbytes
09/28/2022, 10:02 PMBlobby
09/28/2022, 10:04 PMsql
create or replace function "CreateScrapedUpload" (
_filename text,
_record_count int,
) returns table (
id uuid,
filename text,
storage_key text
record_count int,
notes text,
checkbox boolean
) as $$
insert into rr_upload (
filename,
storage_key,
record_count,
notes,
checkbox,
)
select
filename,
extensions.uuid_generate_v4()
_record_count
_filename,
"",
false
from public.rr_upload rr
returning id, filename, storage_key;
$$ language sql volatile;
Error: Failed to create function: failed to create pg.functions: syntax error at or near ")"
tdhyunk
09/28/2022, 11:00 PMFainaru
09/28/2022, 11:28 PMAllYourSupabase
09/29/2022, 1:46 AMAmusedGrape
09/29/2022, 3:31 AMwei
09/29/2022, 3:47 AMjuniorco
09/29/2022, 5:20 AMSUPABASE_ACCESS_TOKEN
from?flotTopz
09/29/2022, 5:50 AMDraz
09/29/2022, 6:36 AMghm
09/29/2022, 7:18 AMHomemadesteam58
09/29/2022, 8:45 AMdmytro.eth
09/29/2022, 12:08 PM/supabase/config.toml
but no setting for the minor. How can I specify a minor version there as well?
I tried adding minor_version = 1
but it didn't workWee
09/29/2022, 4:29 PMlewisd
09/29/2022, 8:50 PMLinking.addEventListener('url', event => {
let urlString = event.url.replace('app#', 'app?');
let url = new URL(urlString);
console.log({url});
let refreshToken = url.searchParams.get('refresh_token');
console.log({refreshToken});
if (refreshToken) {
supabase.auth.getUser(refreshToken).then(res => {
setCurrentUser(res.data.user);
});
}
});
I don't think getUser
is the right thing to be using here? This is using the Google provider btw.
It worked using 1.5
but auth has obviously changed and the docs aren't completed yet.BoogersLLC
09/29/2022, 9:08 PMuser
and it is populated, the supabaseClient
call will still make my call with my anon
key and not the user's token.
Thus, every time I refresh the page, all queries return an empty array.
typescript
async function loadData() {
const { data } = await supabaseClient
.from('test')
.select('*');
loadedData = data;
}
$: if ($page.data.session.user) {
loadData(); // <-- This returns [] on load
}
Unless, I wrap the supabaseClient call in setTimeout(()=>{},0)
. This feels like a hack and I'm wondering what I'm missing?
typescript
$: if ($page.data.session.user) {
setTimeout(() => loadData(), 1);
// ^^ -- This works but feels hacky
}
---
I saw someone made a similar post but using nextjs, that post said not only do you have to look for the user, but also isLoadingUser
. Looking through the documentation I don't see any mention of that or understand if that's a purely nextjs/react thing?