fix build errors

This commit is contained in:
padreug 2025-09-14 19:12:12 +02:00
parent 963aa42662
commit c74945874c
2 changed files with 17 additions and 5 deletions

View file

@ -97,7 +97,11 @@ watch(() => props.open, async (isOpen) => {
if (isOpen && eventsApi && !loadingCurrencies.value) {
loadingCurrencies.value = true
try {
availableCurrencies.value = await eventsApi.getCurrencies()
// Type cast to ensure getCurrencies method exists
const apiService = eventsApi as any
if (apiService.getCurrencies) {
availableCurrencies.value = await apiService.getCurrencies()
}
} catch (error) {
console.warn('Failed to load currencies:', error)
// Keep default currencies
@ -107,7 +111,7 @@ watch(() => props.open, async (isOpen) => {
}
})
const { resetForm, values, meta } = form
const { resetForm, meta } = form
const isFormValid = computed(() => meta.value.valid)
const isLoading = ref(false)
@ -123,7 +127,9 @@ const onSubmit = form.handleSubmit(async (formValues) => {
return
}
const preferredWallet = paymentService.getPreferredWallet()
// Type cast to ensure getPreferredWallet method exists
const paymentSvc = paymentService as any
const preferredWallet = paymentSvc?.getPreferredWallet?.()
if (!preferredWallet) {
toastService.error('No wallet available. Please connect a wallet first.')
return

View file

@ -89,12 +89,18 @@ async function handleCreateEvent(eventData: CreateEventRequest) {
throw new Error('Payment service not available')
}
const adminKey = paymentService.getPreferredWalletAdminKey()
// Type cast to ensure getPreferredWalletAdminKey method exists
const paymentSvc = paymentService as any
const adminKey = paymentSvc?.getPreferredWalletAdminKey?.()
if (!adminKey) {
throw new Error('No wallet admin key available. Please connect a wallet first.')
}
await eventsApi.createEvent(eventData, adminKey)
// Type cast to ensure createEvent method exists
const eventsSvc = eventsApi as any
if (eventsSvc?.createEvent) {
await eventsSvc.createEvent(eventData, adminKey)
}
}
function handleEventCreated() {