Ape R Us
04/10/2022, 11:53 PMexport const user = readable(null, (set) => {
set(supabase.auth.user());
const unsubscribe = supabase.auth.onAuthStateChange((_, session) => {
session ? set(session.user) : set(null);
});
return () => {
unsubscribe.data.unsubscribe();
};
});
jar
04/11/2022, 12:35 AMLika3llobo
04/11/2022, 5:25 AMjoshcowan25
04/11/2022, 5:38 AMkoho
04/11/2022, 6:17 AMJZFLei
04/11/2022, 7:47 AMicesilt.eth
04/11/2022, 9:02 AMNeedle
04/11/2022, 9:03 AM/title
command!
We have solved your problem?
Click the button below to archive it.Needle
04/11/2022, 9:04 AM/title
command!
We have solved your problem?
Click the button below to archive it.anon_123
04/11/2022, 10:42 AMauth.users.id
as a foreign key relation on my data?
Example: I have a list of posts (visible to everyone) these posts have a user_id
that is the aforementioned foreign key.
Now if userA goes and looks at userBs post: supabase.from('posts').select('*').match({ id: userA.id })
he is gonna get the user_id
too!
Is this bad? Should I have a seperate table? What could go wrong?
Does supabase have column level security like for example Keystone?jar
04/11/2022, 3:54 PMApe R Us
04/11/2022, 5:28 PMconst { data: events, error } = await supabase
.from('event')
.select('name,organiser, event_branding(*)')
.eq('is_live', 'false');
and im getting the data and can pass the props to a component after the each block like this
{#each events as event}
<EventCard {...event} />
{/each}
however the coloums in the event_branding table is also an array, how do i get that out in the new component .
sent a pick as wellYogSothot
04/11/2022, 5:45 PMErwin
04/11/2022, 5:55 PM{"message":"no Route matched with those values"}
anon_123
04/11/2022, 6:26 PMsupabase.auth.user()
checkjustcode123
04/11/2022, 6:53 PMAmusedGrape
04/11/2022, 7:14 PMVM
04/11/2022, 7:19 PMCipherCode
04/11/2022, 9:37 PMjs
async function user_salt(user) {
let database = await supabase
.from("user")
.select("user_salt")
.eq("email", user.email);
return database.user_salt;
}
but its returning a Promisejar
04/12/2022, 4:21 AMPaul
04/12/2022, 5:18 AMjar
04/12/2022, 6:05 AM-- declare
-- newusername text := generate_available_username();
-- newusername text := uuid_generate_v4();
begin
insert into public.profiles(username)
values(uuid_generate_v4());
return new;
end
or
begin
new.username := uuid_generate_v4();
return new;
end
anon_123
04/12/2022, 8:37 AMkingpeppe
04/12/2022, 9:22 AMjs
export const updateEthBalance = async (ethAddress, ethBalance) => {
const { data, error } = await supabase.from('users').select().eq('ethAddress', ethAddress).update({ ethBalance: ethBalance })
console.log(data);
};
Am I doing it wrong?Needle
04/12/2022, 9:57 AM/title
command!
We have solved your problem?
Click the button below to archive it.djeglin
04/12/2022, 11:13 AMpassword authentication failed for user "postgres"
β Is this normal?justcode123
04/12/2022, 11:53 AMimport { useEffect, useState } from 'react';
import { supabase } from '../lib/initSupabase';
export default function CountryList() {
const [countries, setCountries] = useState([]);
useEffect(() => {
fetchCountries();
}, []);
const fetchCountries = async () => {
const { data: countries } = await supabase
.from('countries')
.select('*')
.order('name', true);
setCountries(countries);
};
return (
<ul>
{countries.map((country) => (
<li key={country.id}>{country.name}</li>
))}
</ul>
);
}
vbaluch
04/12/2022, 12:40 PMScotty
04/12/2022, 12:53 PMPaul
04/12/2022, 1:53 PM