fix: Resolve build errors (remove unused variables and fix types)

This commit is contained in:
2025-12-07 19:31:32 +03:00
parent 7fb9347528
commit 57d84d0a20
11 changed files with 14 additions and 14 deletions

View File

@@ -45,7 +45,7 @@ export function PaymentList({ reservationId, payments }: PaymentListProps) {
await addPayment(reservationId, formData) await addPayment(reservationId, formData)
setOpen(false) setOpen(false)
toast.success("Ödeme eklendi") toast.success("Ödeme eklendi")
} catch (error) { } catch {
toast.error("Ödeme eklenirken hata oluştu") toast.error("Ödeme eklenirken hata oluştu")
} finally { } finally {
setLoading(false) setLoading(false)
@@ -57,7 +57,7 @@ export function PaymentList({ reservationId, payments }: PaymentListProps) {
try { try {
await deletePayment(id, reservationId) await deletePayment(id, reservationId)
toast.success("Ödeme silindi") toast.success("Ödeme silindi")
} catch (error) { } catch {
toast.error("Silinirken hata oluştu") toast.error("Silinirken hata oluştu")
} }
} }
@@ -67,7 +67,7 @@ export function PaymentList({ reservationId, payments }: PaymentListProps) {
try { try {
await cancelPayment(id, reservationId) await cancelPayment(id, reservationId)
toast.success("Ödeme iptal edildi") toast.success("Ödeme iptal edildi")
} catch (error) { } catch {
toast.error("İptal edilirken hata oluştu") toast.error("İptal edilirken hata oluştu")
} }
} }

View File

@@ -127,7 +127,7 @@ export function ReservationForm({ halls, customers, packages }: ReservationFormP
if (result && result.error) { if (result && result.error) {
setError(result.error) setError(result.error)
} }
} catch (e) { } catch {
setError("Beklenmedik bir hata oluştu.") setError("Beklenmedik bir hata oluştu.")
} finally { } finally {
setLoading(false) setLoading(false)

View File

@@ -66,11 +66,11 @@ export default async function AuditLogsPage({
} }
// Manually fetch profiles for the logs // Manually fetch profiles for the logs
let logsWithProfiles = [] let logsWithProfiles: AuditLog[] = []
if (logs) { if (logs) {
const userIds = Array.from(new Set(logs.map((log: AuditLog) => log.user_id).filter(Boolean))) const userIds = Array.from(new Set(logs.map((log: AuditLog) => log.user_id).filter(Boolean)))
let profilesMap: Record<string, any> = {} let profilesMap: Record<string, { full_name: string; role: string }> = {}
if (userIds.length > 0) { if (userIds.length > 0) {
const { data: profiles } = await client const { data: profiles } = await client
@@ -81,7 +81,7 @@ export default async function AuditLogsPage({
if (profiles) { if (profiles) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
profilesMap = profiles.reduce((acc: any, profile: any) => { profilesMap = profiles.reduce((acc: any, profile: any) => {
acc[profile.id] = profile acc[profile.id] = profile as { full_name: string; role: string }
return acc return acc
}, {}) }, {})
} }

View File

@@ -47,7 +47,7 @@ export function PackageForm() {
await createPackage(values) await createPackage(values)
router.push('/dashboard/settings/packages') router.push('/dashboard/settings/packages')
router.refresh() router.refresh()
} catch (error) { } catch {
alert("Bir hata oluştu") alert("Bir hata oluştu")
} finally { } finally {
setLoading(false) setLoading(false)

View File

@@ -56,7 +56,7 @@ export function EditUserForm({ user }: EditUserFormProps) {
router.push('/dashboard/settings/users') router.push('/dashboard/settings/users')
router.refresh() router.refresh()
} }
} catch (error) { } catch {
toast.error("Bir hata oluştu") toast.error("Bir hata oluştu")
} finally { } finally {
setLoading(false) setLoading(false)

View File

@@ -1,7 +1,6 @@
'use server' 'use server'
import { createAdminClient } from "@/lib/supabase/admin" import { createAdminClient } from "@/lib/supabase/admin"
import { createClient } from "@/lib/supabase/server" // For regular client if needed
import { revalidatePath } from "next/cache" import { revalidatePath } from "next/cache"
import { logAction } from "@/lib/logger" import { logAction } from "@/lib/logger"

View File

@@ -51,7 +51,7 @@ export function UserForm() {
router.push('/dashboard/settings/users') router.push('/dashboard/settings/users')
router.refresh() router.refresh()
} }
} catch (error) { } catch {
toast.error("Bir hata oluştu") toast.error("Bir hata oluştu")
} finally { } finally {
setLoading(false) setLoading(false)

View File

@@ -8,7 +8,7 @@ import {
TableRow, TableRow,
} from "@/components/ui/table" } from "@/components/ui/table"
import { Button } from "@/components/ui/button" import { Button } from "@/components/ui/button"
import { Plus, UserCog } from "lucide-react" import { Plus } from "lucide-react"
import Link from "next/link" import Link from "next/link"
import { Badge } from "@/components/ui/badge" import { Badge } from "@/components/ui/badge"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"

View File

@@ -52,6 +52,7 @@ export function CalendarView({ events = [], halls = [] }: CalendarViewProps) {
router.push(`/dashboard/reservations/${event.id}`) router.push(`/dashboard/reservations/${event.id}`)
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const handleSelectSlot = ({ start, end }: { start: Date, end: Date }) => { const handleSelectSlot = ({ start, end }: { start: Date, end: Date }) => {
// Optional: Navigate to create page // Optional: Navigate to create page
} }
@@ -106,6 +107,7 @@ export function CalendarView({ events = [], halls = [] }: CalendarViewProps) {
event: "Etkinlik", event: "Etkinlik",
noEventsInRange: "Bu aralıkta etkinlik yok." noEventsInRange: "Bu aralıkta etkinlik yok."
}} }}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
eventPropGetter={(event) => ({ eventPropGetter={(event) => ({
className: "bg-primary text-primary-foreground text-xs rounded-md border-none px-2 py-1 shadow-sm hover:bg-primary/90 transition-colors cursor-pointer" className: "bg-primary text-primary-foreground text-xs rounded-md border-none px-2 py-1 shadow-sm hover:bg-primary/90 transition-colors cursor-pointer"
})} })}

View File

@@ -4,7 +4,7 @@ import Link from "next/link"
import { usePathname } from "next/navigation" import { usePathname } from "next/navigation"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils"
import { Button } from "@/components/ui/button" import { Button } from "@/components/ui/button"
import { CalendarDays, Users, Home, Settings, Building2, CreditCard, LogOut, Receipt } from "lucide-react" import { CalendarDays, Users, Home, Settings, Building2, CreditCard, Receipt } from "lucide-react"
interface MainNavProps extends React.HTMLAttributes<HTMLElement> { interface MainNavProps extends React.HTMLAttributes<HTMLElement> {
onNavClick?: () => void onNavClick?: () => void

View File

@@ -11,7 +11,6 @@ export function MobileSidebar({ user }: { user?: { name: string | null; email: s
const [isMounted, setIsMounted] = useState(false) const [isMounted, setIsMounted] = useState(false)
useEffect(() => { useEffect(() => {
// eslint-disable-next-line react-hooks/exhaustive-deps
setIsMounted(true) setIsMounted(true)
}, []) }, [])