fix: Resolve build errors (remove unused variables and fix types)
This commit is contained in:
@@ -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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
}, {})
|
}, {})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user