fix: disambiguate profiles FK in Supabase queries (creator vs likes)
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 27s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 27s
This commit is contained in:
parent
f80131804e
commit
234c6dff54
@ -33,7 +33,7 @@ export function Explore() {
|
||||
const [podcastsRes, tagsRes] = await Promise.all([
|
||||
supabase
|
||||
.from('podcasts')
|
||||
.select('*, creator:profiles(*), tags:podcast_tags(tag:tags(*))')
|
||||
.select('*, creator:profiles!podcasts_creator_id_fkey(*), tags:podcast_tags(tag:tags(*))')
|
||||
.order(sortBy === 'trending' ? 'plays_count' : sortBy === 'duration' ? 'duration_seconds' : 'created_at', { ascending: false })
|
||||
.limit(50),
|
||||
supabase.from('tags').select('*').order('name'),
|
||||
|
||||
@ -15,7 +15,7 @@ export function Favorites() {
|
||||
async function load() {
|
||||
const { data } = await supabase
|
||||
.from('likes')
|
||||
.select('podcast:podcasts(*, creator:profiles(*), tags:podcast_tags(tag:tags(*)))')
|
||||
.select('podcast:podcasts(*, creator:profiles!podcasts_creator_id_fkey(*), tags:podcast_tags(tag:tags(*)))')
|
||||
.eq('user_id', user!.id)
|
||||
.order('created_at', { ascending: false })
|
||||
|
||||
|
||||
@ -17,12 +17,12 @@ export function Home() {
|
||||
const [trendingRes, recentRes] = await Promise.all([
|
||||
supabase
|
||||
.from('podcasts')
|
||||
.select('*, creator:profiles(*), tags:podcast_tags(tag:tags(*))')
|
||||
.select('*, creator:profiles!podcasts_creator_id_fkey(*), tags:podcast_tags(tag:tags(*))')
|
||||
.order('plays_count', { ascending: false })
|
||||
.limit(8),
|
||||
supabase
|
||||
.from('podcasts')
|
||||
.select('*, creator:profiles(*), tags:podcast_tags(tag:tags(*))')
|
||||
.select('*, creator:profiles!podcasts_creator_id_fkey(*), tags:podcast_tags(tag:tags(*))')
|
||||
.order('created_at', { ascending: false })
|
||||
.limit(8),
|
||||
])
|
||||
|
||||
@ -28,7 +28,7 @@ export function PodcastDetail() {
|
||||
async function load() {
|
||||
const { data: p } = await supabase
|
||||
.from('podcasts')
|
||||
.select('*, creator:profiles(*), tags:podcast_tags(tag:tags(*))')
|
||||
.select('*, creator:profiles!podcasts_creator_id_fkey(*), tags:podcast_tags(tag:tags(*))')
|
||||
.eq('id', id)
|
||||
.single()
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ export function Profile() {
|
||||
const [podcastsRes, followersRes, followingRes] = await Promise.all([
|
||||
supabase
|
||||
.from('podcasts')
|
||||
.select('*, creator:profiles(*), tags:podcast_tags(tag:tags(*))')
|
||||
.select('*, creator:profiles!podcasts_creator_id_fkey(*), tags:podcast_tags(tag:tags(*))')
|
||||
.eq('creator_id', profileData.id)
|
||||
.order('created_at', { ascending: false }),
|
||||
supabase.from('follows').select('*', { count: 'exact', head: true }).eq('following_id', profileData.id),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user