From d9523cc78464a8bdf27f26c3b809e0c41fd50587 Mon Sep 17 00:00:00 2001 From: padreug Date: Fri, 1 Aug 2025 23:11:48 +0200 Subject: [PATCH] refactor: Remove unused getCurrentUser function and clean up imports in events.ts - Eliminate the unused getCurrentUser function from useAuth.ts to streamline authentication logic. - Clean up imports in events.ts by removing the unused Event type, enhancing code clarity and maintainability. --- src/composables/useAuth.ts | 13 +------------ src/lib/api/events.ts | 4 ++-- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/composables/useAuth.ts b/src/composables/useAuth.ts index 944e756..be80af2 100644 --- a/src/composables/useAuth.ts +++ b/src/composables/useAuth.ts @@ -152,18 +152,7 @@ export function useAuth() { } }) - // Get current user from API - async function getCurrentUser(): Promise { - try { - console.log('Getting current user from API...') - const user = await lnbitsAPI.getCurrentUser() - console.log('Current user from API:', user) - return user - } catch (error) { - console.error('Error getting current user:', error) - return null - } - } + return { // State diff --git a/src/lib/api/events.ts b/src/lib/api/events.ts index d9b1ec9..f1ca2ee 100644 --- a/src/lib/api/events.ts +++ b/src/lib/api/events.ts @@ -1,4 +1,4 @@ -import type { Event, EventsApiError, Ticket } from '../types/event' +import type { Event, Ticket } from '../types/event' import { config } from '@/lib/config' import { lnbitsAPI } from './lnbits' @@ -72,7 +72,7 @@ export async function purchaseTicket(eventId: string): Promise<{ payment_hash: s } } -export async function payInvoiceWithWallet(paymentRequest: string, walletId: string, adminKey: string): Promise<{ payment_hash: string; fee_msat: number; preimage: string }> { +export async function payInvoiceWithWallet(paymentRequest: string, _walletId: string, adminKey: string): Promise<{ payment_hash: string; fee_msat: number; preimage: string }> { try { const response = await fetch( `${API_BASE_URL}/api/v1/payments`,