Fix type errors

This commit is contained in:
2025-10-16 20:44:52 +02:00
parent c80fc61539
commit baca5415c3
12 changed files with 56 additions and 43 deletions
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { sluggy } from '#imports';
import { useI18nKey } from '~/composables/useI18nKey';
import { useTitleStore } from '~/stores/title';
@@ -42,7 +43,7 @@ titleStore.title = data.value ? tKey(data.value, 'title').value : undefined;
<VaButton
icon="arrow_back"
:to="
$localePath(
localePath(
`/hunt/${data ? tSluggy(data.hunt).value : sluggy(huntSlug!)}`
)
"
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { parseError, sluggy } from '#imports';
import { compressImage, createImageURL } from '#shared/utils/image';
import ClickableImage from '~/components/ClickableImage.vue';
import MultilineString from '~/components/MultilineString.vue';
@@ -17,6 +18,7 @@ const { user } = useUserSession();
const { huntSlug, questSlug } = app.$slugData;
const { t, d, locale } = useI18n();
const localePath = useLocalePath();
const { tKey, hasKey, tSluggy } = useI18nKey();
const titleStore = useTitleStore();
@@ -176,7 +178,7 @@ async function submit() {
<VaButton
icon="arrow_back"
:to="
$localePath(
localePath(
`/hunt/${data ? tSluggy(data.hunt).value : sluggy(huntSlug!)}`
)
"
@@ -196,7 +198,7 @@ async function submit() {
v-if="user && user.role === 'ADMIN'"
color="danger"
:to="
$localePath(
localePath(
`/hunt/${data?.hunt ? tSluggy(data.hunt).value : sluggy(huntSlug!)}/${data ? tSluggy(data).value : sluggy(questSlug!)}}/admin`
)
"
+4 -2
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { sluggy } from '#imports';
import { useTitleStore } from '~/stores/title';
definePageMeta({
@@ -7,6 +8,7 @@ definePageMeta({
const app = useNuxtApp();
const { loggedIn } = useUserSession();
const { t } = useI18n();
const localePath = useLocalePath();
const { tKey } = useI18nKey();
const { name, id } = app.$slugData.huntSlug!;
@@ -100,7 +102,7 @@ titleStore.title = data.value?.name;
}}</VaAlert
><VaButton
icon="arrow_back"
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
:to="localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
>{{ t('page.common.back_to_hunt') }}</VaButton
>
</div>
@@ -113,7 +115,7 @@ titleStore.title = data.value?.name;
}}</VaAlert
><VaButton
icon="arrow_back"
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
:to="localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
>{{ t('page.common.back_to_hunt') }}</VaButton
>
</div>
+11 -9
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { parseError } from '#imports';
import TeamAddModal from '~/components/TeamAddModal.vue';
import { useSettingsStore } from '~/stores/settings';
import { useTitleStore } from '~/stores/title';
@@ -7,6 +8,7 @@ import { fullDate } from '~~/server/utils/date';
const app = useNuxtApp();
const { loggedIn } = useUserSession();
const { t, d } = useI18n();
const localePath = useLocalePath();
const { tKey, hasKey, tSluggy } = useI18nKey();
const { init } = useToast();
@@ -95,34 +97,34 @@ ${document.location.href}`
v-if="(data?.revealAnswers && data?.revealQuests) || data?.isMember"
color="success"
icon="leaderboard"
:to="$localePath(`/hunt/${tSluggy(data).value}/showcase`)"
:to="localePath(`/hunt/${tSluggy(data).value}/showcase`)"
>{{ t('page.hunt.showcase') }}</VaButton
>
<VaButton
v-if="(data?.revealAnswers && data?.revealQuests) || data?.isMember"
color="success"
icon="collections"
:to="$localePath(`/hunt/${tSluggy(data).value}/diashow`)"
:to="localePath(`/hunt/${tSluggy(data).value}/diashow`)"
>{{ t('page.hunt.diashow') }}</VaButton
>
<VaButton
v-if="(data?.revealAnswers && data?.revealQuests) || data?.isMember"
color="success"
icon="auto_awesome_mosaic"
:to="$localePath(`/hunt/${tSluggy(data).value}/pictures`)"
:to="localePath(`/hunt/${tSluggy(data).value}/pictures`)"
>{{ t('page.hunt.all_pictures') }}</VaButton
>
<VaButton
v-if="data?.isMember"
color="danger"
icon="edit"
:to="$localePath(`/hunt/${tSluggy(data).value}/admin`)"
:to="localePath(`/hunt/${tSluggy(data).value}/admin`)"
>{{ t('page.common.admin') }}</VaButton
><VaButton
v-if="data?.isMember"
color="danger"
icon="groups"
:to="$localePath(`/hunt/${tSluggy(data).value}/teams`)"
:to="localePath(`/hunt/${tSluggy(data).value}/teams`)"
>{{ t('page.hunt.teams') }}</VaButton
>
</div>
@@ -199,7 +201,7 @@ ${document.location.href}`
<VaButton
color="info"
icon="login"
:to="$localePath(`/login?to=/hunt/${tSluggy(data).value}`)"
:to="localePath(`/login?to=/hunt/${tSluggy(data).value}`)"
>{{ t('page.common.login_first') }}</VaButton
>
</VaCardActions>
@@ -267,7 +269,7 @@ ${document.location.href}`
<VaCardActions>
<VaButton
:to="
$localePath(
localePath(
`/hunt/${tSluggy(data).value}/${tSluggy(quest).value}`
)
"
@@ -291,7 +293,7 @@ ${document.location.href}`
"
:icon="(quest.unreviewed || 0) > 0 ? 'priority_high' : undefined"
:to="
$localePath(
localePath(
`/hunt/${tSluggy(data).value}/${tSluggy(quest).value}/admin`
)
"
@@ -312,7 +314,7 @@ ${document.location.href}`
<div v-if="error">
<h1 class="mt-8 text-3xl">{{ t(parseError(error)) }}</h1>
<VaButton icon="arrow_back" :to="$localePath(`/`)">{{
<VaButton icon="arrow_back" :to="localePath(`/`)">{{
t('page.common.back_home')
}}</VaButton>
</div>
+4 -2
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { sluggy } from '#imports';
import { unique } from '#shared/utils/array';
import { useTitleStore } from '~/stores/title';
@@ -8,6 +9,7 @@ definePageMeta({
const app = useNuxtApp();
const { loggedIn } = useUserSession();
const { t, locale } = useI18n();
const localePath = useLocalePath();
const { tKey, hasKey } = useI18nKey();
const { name, id } = app.$slugData.huntSlug!;
@@ -161,7 +163,7 @@ titleStore.title = data.value ? tKey(data.value, 'name').value : undefined;
}}</VaAlert
><VaButton
icon="arrow_back"
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
:to="localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
>{{ t('page.common.back_to_hunt') }}</VaButton
>
</div>
@@ -174,7 +176,7 @@ titleStore.title = data.value ? tKey(data.value, 'name').value : undefined;
}}</VaAlert
><VaButton
icon="arrow_back"
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
:to="localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
>{{ t('page.common.back_to_hunt') }}</VaButton
>
</div>
+3 -1
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { sluggy } from '#imports';
import type { DataTableColumnSource } from 'vuestic-ui';
import NumberCard from '~/components/showcase/NumberCard.vue';
import { fullDate } from '~~/server/utils/date';
@@ -7,6 +8,7 @@ definePageMeta({
layout: 'full'
});
const { t, d } = useI18n();
const localePath = useLocalePath();
const { tKey, hasKey, tSluggy } = useI18nKey();
const app = useNuxtApp();
@@ -266,7 +268,7 @@ const columns = leaderboardColumns.map((c) =>
}}</VaAlert
><VaButton
icon="arrow_back"
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
:to="localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
>{{ t('page.common.back_to_hunt') }}</VaButton
>
</article>
+4 -3
View File
@@ -5,6 +5,7 @@ import { fullDate } from '~~/server/utils/date';
const { loggedIn } = useUserSession();
const { data, pending, refresh } = await useFetch('/api/home');
const { t, d } = useI18n();
const localePath = useLocalePath();
const { tKey, tSluggy } = useI18nKey();
watch(loggedIn, () => refresh());
</script>
@@ -26,7 +27,7 @@ watch(loggedIn, () => refresh());
v-for="hunt in data.own"
:key="hunt.id"
stripe
:to="$localePath(`/hunt/${tSluggy(hunt).value}`)"
:to="localePath(`/hunt/${tSluggy(hunt).value}`)"
>
<VaCardTitle>{{ tKey(hunt, 'name') }}</VaCardTitle>
@@ -72,7 +73,7 @@ watch(loggedIn, () => refresh());
class="mt-6"
color="info"
icon="login"
:to="$localePath(`/login`)"
:to="localePath(`/login`)"
>{{ t('page.home.login_first') }}</VaButton
>
</div>
@@ -85,7 +86,7 @@ watch(loggedIn, () => refresh());
<VaCard
v-for="hunt in data.others"
:key="hunt.id"
:to="$localePath(`/hunt/${tSluggy(hunt).value}`)"
:to="localePath(`/hunt/${tSluggy(hunt).value}`)"
>
<VaCardTitle>{{ tKey(hunt, 'name') }}</VaCardTitle>
<ClickableImage
+1 -1
View File
@@ -132,7 +132,7 @@ async function submit() {
t('auth.login')
}}</VaButton>
<VaButton
:to="$localePath({ path: '/register', query: route.query })"
:to="localePath({ path: '/register', query: route.query })"
border-color="primary"
preset="secondary"
>{{ t('auth.register_instead') }}</VaButton
+1 -1
View File
@@ -252,7 +252,7 @@ async function submitPassword() {
/>
<NuxtLink
:to="
$localePath(
localePath(
`/hunt/${tSluggy(item.answer.quest.hunt).value}/${tSluggy(item.answer.quest).value}`
)
"
+1 -1
View File
@@ -164,7 +164,7 @@ async function submit() {
t('auth.register')
}}</VaButton>
<VaButton
:to="$localePath({ path: '/login', query: route.query })"
:to="localePath({ path: '/login', query: route.query })"
border-color="primary"
preset="secondary"
>{{ t('auth.login_instead') }}</VaButton