feat: add events app + "multi-tenants" aka multi-events

This commit is contained in:
2026-09-16 00:03:26 +02:00
parent b5c2cdc037
commit 8b9c254fd2
62 changed files with 1343 additions and 362 deletions
+10 -7
View File
@@ -1,9 +1,10 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { gamesApiListGames } from "./api";
import type { GamesApiListGamesResponse } from "./api/types.gen";
import { gamesApiListEventGames } from "./api";
import type { GamesApiListEventGamesResponse } from "./api/types.gen";
interface Props {
eventPath: string;
marketEnabled?: string | boolean;
}
@@ -11,11 +12,11 @@ const props = withDefaults(defineProps<Props>(), {
marketEnabled: true,
});
const games = ref<GamesApiListGamesResponse | undefined>();
const games = ref<GamesApiListEventGamesResponse | undefined>();
const loading = ref(true);
const imageErrors = ref<Set<number>>(new Set());
const getHeaderImage = (game: GamesApiListGamesResponse[number]) => {
const getHeaderImage = (game: GamesApiListEventGamesResponse[number]) => {
if (game.image) {
return game.image;
}
@@ -30,7 +31,7 @@ const onImageError = (gameId: number) => {
};
const navigate = (path: string) => {
window.location.href = path;
window.location.href = `/${props.eventPath}${path}`;
};
const isMarketEnabled = () => {
@@ -41,8 +42,10 @@ const isMarketEnabled = () => {
};
onMounted(async () => {
// Fetch games list
const response = await gamesApiListGames();
// Fetch games enabled for this event
const response = await gamesApiListEventGames({
path: { event_path: props.eventPath },
});
if (response.data) {
games.value = response.data;
}