refactor: Clean up imports and unused variables in ticket-related components
- Remove unused imports from PurchaseTicketDialog.vue and useUserTickets.ts for improved code clarity. - Update events.ts to eliminate the unused paymentRequest parameter in payInvoiceWithWallet function. - Simplify MyTickets.vue by removing the unused unregisteredTickets variable and related QR code generation logic, enhancing maintainability.
This commit is contained in:
parent
deabf9464a
commit
217ca70334
4 changed files with 8 additions and 15 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<!-- eslint-disable vue/multi-word-component-names -->
|
||||
<script setup lang="ts">
|
||||
import { ref, onUnmounted } from 'vue'
|
||||
import { onUnmounted } from 'vue'
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@/components/ui/dialog'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
|
|
@ -30,7 +30,7 @@ const {
|
|||
isLoading,
|
||||
error,
|
||||
paymentHash,
|
||||
paymentRequest,
|
||||
|
||||
qrCode,
|
||||
isPaymentPending,
|
||||
isPayingWithWallet,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ref, computed } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useAsyncState } from '@vueuse/core'
|
||||
import type { Ticket } from '@/lib/types/event'
|
||||
import { fetchUserTickets } from '@/lib/api/events'
|
||||
|
|
|
|||
|
|
@ -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`,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { ScrollArea } from '@/components/ui/scroll-area'
|
|||
import { Button } from '@/components/ui/button'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { format } from 'date-fns'
|
||||
import { Ticket, User, Calendar, CreditCard, CheckCircle, Clock, AlertCircle, QrCode, ChevronLeft, ChevronRight } from 'lucide-vue-next'
|
||||
import { Ticket, User, CreditCard, CheckCircle, Clock, AlertCircle, ChevronLeft, ChevronRight } from 'lucide-vue-next'
|
||||
|
||||
const { isAuthenticated, userDisplay } = useAuth()
|
||||
const {
|
||||
|
|
@ -17,7 +17,7 @@ const {
|
|||
paidTickets,
|
||||
pendingTickets,
|
||||
registeredTickets,
|
||||
unregisteredTickets,
|
||||
|
||||
groupedTickets,
|
||||
isLoading,
|
||||
error,
|
||||
|
|
@ -66,14 +66,7 @@ async function generateQRCode(ticketId: string) {
|
|||
}
|
||||
}
|
||||
|
||||
// Generate QR codes for all tickets in a group
|
||||
async function generateAllQRCodes(tickets: any[]) {
|
||||
for (const ticket of tickets) {
|
||||
if (!qrCodes.value[ticket.id]) {
|
||||
await generateQRCode(ticket.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Ticket cycling functions
|
||||
function getCurrentTicketIndex(eventId: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue