Skip to content

Commit

Permalink
fixed barbuddy page showing the wrong people when the language is cha…
Browse files Browse the repository at this point in the history
…nged
  • Loading branch information
ilgazer committed Jan 12, 2025
1 parent f2d9ae9 commit e5f5b4e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions shared/pages/barbuddy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,13 @@ nl:
</i18n>

<script setup>
const { t, locale } = useT()
const { t } = useT()
const runtimeConfig = useRuntimeConfig()
const { data: barBuddies } = await useAsyncData(() =>
queryContent('barbuddies')
.where({
sites: { $contains: runtimeConfig.public.domain },
[locale.value]: { $type: 'string' },
})
.find()
)
const { data: barBuddies } = await useAsyncData(() => queryContent('barbuddies').find())
const listBackgroundClass = runtimeConfig.public.domain == 'outsite.nl' ? 'bg-brand-300' : 'bg-brand-500'
const listBackgroundClass = runtimeConfig.public.domain === 'outsite.nl' ? 'bg-brand-300' : 'bg-brand-500'
</script>

<template>
Expand All @@ -49,7 +42,12 @@ const listBackgroundClass = runtimeConfig.public.domain == 'outsite.nl' ? 'bg-br
</template>

<div class="grid gap-4 md:grid-cols-2">
<div v-for="buddy in barBuddies" :key="buddy.name">
<div
v-for="buddy in barBuddies.filter(
(b) => b.sites.indexOf(runtimeConfig.public.domain) !== -1 && b[$i18n.locale]
)"
:key="buddy.name"
>
<PagesBarbuddyCard :buddy="buddy" />
</div>
</div>
Expand All @@ -60,7 +58,9 @@ const listBackgroundClass = runtimeConfig.public.domain == 'outsite.nl' ? 'bg-br
{{ t('sign_up') }}
</h2>
<div class="mx-auto mt-8 md:w-2/3">
<PagesBarbuddyForm :barBuddies="barBuddies" />
<PagesBarbuddyForm
:barBuddies="barBuddies.filter((b) => b.sites.indexOf(runtimeConfig.public.domain) !== -1 && b[$i18n.locale])"
/>
</div>
</LayoutStraightSection>
</template>

0 comments on commit e5f5b4e

Please sign in to comment.