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