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 -10
View File
@@ -25,9 +25,9 @@ export const useMarketStore = defineStore('market', () => {
}
}
const loadMarkets = async () => {
const loadMarkets = async (eventPath: string) => {
try {
const response = await marketApiListMarkets()
const response = await marketApiListMarkets({ path: { event_path: eventPath } })
if (response.data) {
markets.value = response.data as unknown as Market[]
}
@@ -37,9 +37,9 @@ export const useMarketStore = defineStore('market', () => {
}
}
const loadUserBets = async () => {
const loadUserBets = async (eventPath: string) => {
try {
const response = await marketApiListUserBets()
const response = await marketApiListUserBets({ path: { event_path: eventPath } })
if (response.data) {
userBets.value = response.data
}
@@ -49,30 +49,30 @@ export const useMarketStore = defineStore('market', () => {
}
}
const initializeMarketPage = async () => {
const initializeMarketPage = async (eventPath: string) => {
isLoading.value = true
error.value = ''
try {
await Promise.all([
loadUserInfo(),
loadMarkets(),
loadMarkets(eventPath),
])
// Load user bets if authenticated
if (userInfo.value?.is_authenticated) {
await loadUserBets()
await loadUserBets(eventPath)
}
} finally {
isLoading.value = false
}
}
const refreshPage = async () => {
const refreshPage = async (eventPath: string) => {
await Promise.all([
loadUserInfo(),
loadMarkets(),
userInfo.value?.is_authenticated ? loadUserBets() : Promise.resolve(),
loadMarkets(eventPath),
userInfo.value?.is_authenticated ? loadUserBets(eventPath) : Promise.resolve(),
])
}