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.
This commit is contained in:
parent
0cc0bf3555
commit
d9523cc784
2 changed files with 3 additions and 14 deletions
|
|
@ -152,18 +152,7 @@ export function useAuth() {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Get current user from API
|
|
||||||
async function getCurrentUser(): Promise<User | null> {
|
|
||||||
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 {
|
return {
|
||||||
// State
|
// State
|
||||||
|
|
|
||||||
|
|
@ -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 { config } from '@/lib/config'
|
||||||
import { lnbitsAPI } from './lnbits'
|
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 {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${API_BASE_URL}/api/v1/payments`,
|
`${API_BASE_URL}/api/v1/payments`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue