kelbs
08/22/2021, 1:39 AMsilentworks
08/22/2021, 2:53 AMEthanxyz
08/22/2021, 4:39 AMXyo
08/22/2021, 4:45 AMXyo
08/22/2021, 4:45 AMselectalldelete
08/22/2021, 8:00 PMAshley~
08/22/2021, 8:05 PMmanusabarros
08/23/2021, 3:59 AMQuqlock
08/23/2021, 10:03 AMKellen Mace
08/23/2021, 3:44 PMKellen Mace
08/23/2021, 3:44 PMKellen Mace
08/23/2021, 3:45 PMrule_channels
DB table with a rule_id
column.
rule_id
has a foreign key relation to table rules
on column id
.
I query for rules like this in my codebase:
import type { definitions } from '../../../types/supabase';
const { data, error } = await supabase
.from<definitions['rules']>('rules')
.select(`
id,
words,
rule_channels (
channel_id:channels ( id, title )
)
`)
.eq('id', ruleId)
.single();
But attempting to use the data that comes back results in this TypeScript error:
Property 'rule_channels' does not exist on type '{ id: number; words: string; created_by: string; updated_at: string; }'.ts(2339)
Kellen Mace
08/23/2021, 3:45 PMHal
08/23/2021, 3:50 PMStrift
08/23/2021, 4:02 PMStrift
08/23/2021, 4:04 PMsjm
08/23/2021, 5:40 PMLink
08/23/2021, 6:45 PMLucho Suárez
08/23/2021, 8:33 PMuser
08/23/2021, 9:00 PMasync fetch() {
const user = await this.$supabase.auth.user()
if (user) {
return await this.$router.push('/shifts')
}
},
However, when the user is redirect back, user is not set. I have to refresh the page again for it to be set.
I am guessing there is some race condition here. Does anyone know a way to resolve this?lx_23
08/24/2021, 4:36 AMlx_23
08/24/2021, 4:37 AMuser
08/24/2021, 5:08 AMStrift
08/24/2021, 9:49 AMsjm
08/24/2021, 9:52 AMsilentworks
08/24/2021, 9:56 AMuser
08/24/2021, 12:22 PM