Commit 629ab9a4 authored by Hendrik Garske's avatar Hendrik Garske

Fix: ESLint Fehler behoben

parent 0ad3cb94
Pipeline #11 failed with stages
in 1 minute and 37 seconds
......@@ -76,7 +76,7 @@ export async function POST(request: NextRequest) {
return NextResponse.json(
{
error: errorMessage,
details: process.env.NODE_ENV === 'development' ? error?.stack : undefined
details: process.env.NODE_ENV === 'development' && error instanceof Error ? error.stack : undefined
},
{ status: 500 }
)
......
......@@ -12,12 +12,14 @@ export async function GET() {
message: "Prisma connection successful",
customerCount
})
} catch (error: any) {
} catch (error: unknown) {
console.error("Test error:", error)
const errorMessage = error instanceof Error ? error.message : "Unknown error"
const errorStack = process.env.NODE_ENV === 'development' && error instanceof Error ? error.stack : undefined
return NextResponse.json({
success: false,
error: error?.message || "Unknown error",
stack: process.env.NODE_ENV === 'development' ? error?.stack : undefined
error: errorMessage,
stack: errorStack
}, { status: 500 })
}
}
......
......@@ -45,7 +45,7 @@ export default function CustomerDetail() {
if (params.id) {
fetchCustomer()
}
}, [params.id])
}, [params.id]) // eslint-disable-line react-hooks/exhaustive-deps
const fetchCustomer = async () => {
try {
......
......@@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Textarea } from "@/components/ui/textarea"
import { Plus, Search, Edit, Trash2, Clock, User, Building, Mail, Phone, MapPin } from "lucide-react"
import { Plus, Search, Edit, Trash2, Clock, Building, Mail, Phone, MapPin } from "lucide-react"
import Link from "next/link"
interface Customer {
......@@ -96,7 +96,7 @@ export default function Kunden() {
try {
const errorData = await response.json()
errorMessage = errorData.error || errorMessage
} catch (e) {
} catch {
errorMessage = `Server-Fehler (Status ${response.status})`
}
} else {
......
......@@ -2,7 +2,6 @@
import { Logo } from "@/components/Logo"
import { ThemeToggle } from "@/components/theme-toggle"
import { Button } from "@/components/ui/button"
import Link from "next/link"
import { Clock, User } from "lucide-react"
......
......@@ -67,7 +67,7 @@ export default function Zeiterfassung() {
const ensureCurrentUser = async () => {
try {
const response = await fetch("/api/users", {
await fetch("/api/users", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
......@@ -174,8 +174,8 @@ export default function Zeiterfassung() {
try {
// Get user ID first
const usersResponse = await fetch("/api/users")
const users = await usersResponse.json()
const userId = users.find((u: any) => u.email === "temp@corexmanagement.de")?.id || CURRENT_USER_ID
const users = await usersResponse.json() as Array<{ id: string; email: string }>
const userId = users.find((u) => u.email === "temp@corexmanagement.de")?.id || CURRENT_USER_ID
const response = await fetch("/api/time-entries", {
method: "POST",
......@@ -221,8 +221,8 @@ export default function Zeiterfassung() {
try {
const usersResponse = await fetch("/api/users")
const users = await usersResponse.json()
const userId = users.find((u: any) => u.email === "temp@corexmanagement.de")?.id || CURRENT_USER_ID
const users = await usersResponse.json() as Array<{ id: string; email: string }>
const userId = users.find((u) => u.email === "temp@corexmanagement.de")?.id || CURRENT_USER_ID
const response = await fetch("/api/time-entries", {
method: "POST",
......
import Image from "next/image"
export function Logo({ className = "h-5 md:h-6 w-auto" }: { className?: string }) {
return (
<div className={className}>
<img
<Image
src="/logo.png"
alt="CoreX Management"
width={200}
height={40}
className="h-full w-auto object-contain dark:invert-0 invert"
priority
/>
</div>
)
......
import * as React from "react"
import { cn } from "@/lib/utils"
interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {}
type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement>
const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
({ className, children, ...props }, ref) => {
......
......@@ -3,7 +3,7 @@ import type { NextRequest } from 'next/server'
// TODO: Implement SSO authentication here
// For now, this is a placeholder that allows all requests
export function middleware(request: NextRequest) {
export function middleware(_request: NextRequest) {
// SSO authentication logic will be added here
// Example: Check for authentication token, redirect to login if not authenticated
......
# Migrations werden hier gespeichert
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment