connection01
02/23/2022, 6:30 AMwarlic
02/23/2022, 6:31 AMsilentworks
02/23/2022, 8:34 AMjoshcowan25
02/23/2022, 9:47 AMconnection01
02/23/2022, 3:21 PMjs
let searchTerm
if (searchTerm) {
const {data, error} = supabase.from('products').select('*').ilike('name', '%' + searchTerm +'%')
} else {
const {data, error} = supabase.from('products').select('*')
}
Scott P
02/23/2022, 3:49 PMak4zh
02/23/2022, 4:44 PMcategories
table.pedrodiaz
02/23/2022, 4:53 PMdiegoalzate
02/23/2022, 6:18 PMnah
02/23/2022, 6:19 PMgabydd
02/23/2022, 6:51 PMnah
02/23/2022, 7:27 PMgabydd
02/23/2022, 7:48 PMuser
02/23/2022, 10:44 PMEduardo Lopez
02/24/2022, 2:23 AMEduardo Lopez
02/24/2022, 2:23 AMJoão Vitor
02/24/2022, 2:51 AM<img />
??Kazuto
02/24/2022, 7:35 AMsupabase.client.ts
js
import type { SupabaseClient } from '@supabase/supabase-js'
import { createClient } from '@supabase/supabase-js'
import { defineNuxtPlugin } from '#app'
declare module '#app' {
interface NuxtApp {
$supabase: SupabaseClient
}
}
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$supabase: SupabaseClient
}
}
export default defineNuxtPlugin(() => {
const { supabaseUrl, supabaseKey } = useRuntimeConfig()
const supabase: SupabaseClient = createClient(supabaseUrl, supabaseKey)
return {
provide: {
supabase
}
}
})
But I get the error [worker] Cannot read properties of undefined (reading 'from')
when calling
js
const { $supabase } = useNuxtApp()
const { data, pending } = $supabase.from('categories').select('*')
Kazuto
02/24/2022, 8:12 AMsupabase.client.ts
because nuxt only loads it client side because of the suffix .client
freshandlow
02/24/2022, 10:17 AMsilentworks
02/24/2022, 11:29 AMbaddoh99
02/24/2022, 11:41 AMPaul AKA TDI
02/24/2022, 11:50 AMPixelPage ᶠᵒˡᶤᶻᶻᵃ
02/24/2022, 2:42 PMAmusedGrape
02/24/2022, 3:51 PMTaner Nill
02/24/2022, 4:10 PMScott P
02/24/2022, 4:16 PMsupabase
doesn't exist on AuthProvider
. CMD + Space / CTRL + Space and intellisense should show you what props you can pass to it.Taner Nill
02/24/2022, 4:17 PMTaner Nill
02/24/2022, 4:18 PMPixelPage ᶠᵒˡᶤᶻᶻᵃ
02/24/2022, 6:06 PM