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
+11 -4
View File
@@ -8,19 +8,24 @@ import Winners from "@/components/Winners.vue";
import PuzzleResults from "@/components/PuzzleResults.vue";
import TopUsersLeaderboard from "@/components/TopUsersLeaderboard.vue";
import { polylanSubmitterApiGetUserInfo, opusMagnumApiGetCollection } from "@/api";
import { errorHelpers } from "@/services/apiService";
import { apiService, errorHelpers } from "@/services/apiService";
import { usePuzzlesStore } from "@/stores/puzzles";
import { useSubmissionsStore } from "@/stores/submissions";
import { provideEventPath } from "@/composables/useEventPath";
import type { PuzzleResponse, UserInfo, SteamCollection } from "@/types";
import { useCountdown } from "@vueuse/core";
import { storeToRefs } from "pinia";
const props = defineProps<{
eventPath: string;
collectionTitle: string;
collectionUrl: string;
collectionDescription: string;
}>();
provideEventPath(props.eventPath);
apiService.setEventPath(props.eventPath);
const puzzlesStore = usePuzzlesStore();
const submissionsStore = useSubmissionsStore();
@@ -77,7 +82,9 @@ async function initialize() {
// Load collection data
console.log("Loading collection...");
const collectionResponse = await opusMagnumApiGetCollection();
const collectionResponse = await opusMagnumApiGetCollection({
path: { event_path: props.eventPath },
});
if (collectionResponse.data) {
collection.value = collectionResponse.data as SteamCollection;
console.log("Collection loaded:", collectionResponse.data);
@@ -87,7 +94,7 @@ async function initialize() {
// Load puzzles from API using store
console.log("Loading puzzles...");
await puzzlesStore.loadPuzzles();
await puzzlesStore.loadPuzzles(props.eventPath);
console.log("Puzzles loaded:", puzzlesStore.puzzles.length);
// Load existing submissions using store
@@ -129,7 +136,7 @@ const reloadPage = () => {
};
const goHome = () => {
window.location.href = "/";
window.location.href = `/${props.eventPath}/`;
};
</script>