diff --git a/app/(dashboard)/dashboard/users/actions.ts b/app/(dashboard)/dashboard/users/actions.ts index 03bafca..a30a2d4 100644 --- a/app/(dashboard)/dashboard/users/actions.ts +++ b/app/(dashboard)/dashboard/users/actions.ts @@ -69,8 +69,8 @@ export async function deleteUser(userId: string) { // Check admin try { await assertAdmin() - } catch (error: any) { - return { error: error.message } + } catch (error) { + return { error: (error as Error).message } } // Delete user @@ -87,8 +87,8 @@ export async function updateUser(userId: string, data: { firstName: string, last // Check admin try { await assertAdmin() - } catch (error: any) { - return { error: error.message } + } catch (error) { + return { error: (error as Error).message } } // 1. Update Profile (Role and Name) diff --git a/app/(public)/signup/page.tsx b/app/(public)/signup/page.tsx index 10646d1..86a6fe7 100644 --- a/app/(public)/signup/page.tsx +++ b/app/(public)/signup/page.tsx @@ -39,7 +39,7 @@ export default function SignUpPage() { if (data.user) { setSuccess(true) } - } catch (err: any) { + } catch { setError("Bir hata oluştu. Lütfen tekrar deneyin.") } finally { setLoading(false) diff --git a/components/dashboard/product-form.tsx b/components/dashboard/product-form.tsx index 59b89b9..c079223 100644 --- a/components/dashboard/product-form.tsx +++ b/components/dashboard/product-form.tsx @@ -1,7 +1,7 @@ "use client" import { useState } from "react" -import { useForm } from "react-hook-form" +import { useForm, type Resolver } from "react-hook-form" import { zodResolver } from "@hookform/resolvers/zod" import * as z from "zod" import { Button } from "@/components/ui/button" @@ -59,7 +59,7 @@ export function ProductForm({ initialData }: ProductFormProps) { const [loading, setLoading] = useState(false) const form = useForm({ - resolver: zodResolver(productSchema) as any, + resolver: zodResolver(productSchema) as Resolver, defaultValues: initialData ? { name: initialData.name, category: initialData.category, diff --git a/components/dashboard/settings-tabs.tsx b/components/dashboard/settings-tabs.tsx index a19d737..5afe841 100644 --- a/components/dashboard/settings-tabs.tsx +++ b/components/dashboard/settings-tabs.tsx @@ -1,14 +1,14 @@ "use client" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" -import { SiteSettingsForm } from "@/components/dashboard/site-settings-form" +import { SiteSettingsForm, SettingsFormValues } from "@/components/dashboard/site-settings-form" import { SmsSettingsForm } from "@/components/dashboard/sms-settings-form" import { AppearanceForm } from "@/components/dashboard/appearance-form" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" interface SettingsTabsProps { - siteSettings: Record | null + siteSettings: Partial | null smsSettings: { username: string header: string diff --git a/components/dashboard/site-settings-form.tsx b/components/dashboard/site-settings-form.tsx index 5f88a4e..7f4d8a5 100644 --- a/components/dashboard/site-settings-form.tsx +++ b/components/dashboard/site-settings-form.tsx @@ -30,10 +30,10 @@ const settingsSchema = z.object({ currency: z.string(), }) -type SettingsFormValues = z.infer +export type SettingsFormValues = z.infer interface SiteSettingsFormProps { - initialData: any + initialData: Partial | null } export function SiteSettingsForm({ initialData }: SiteSettingsFormProps) { diff --git a/components/dashboard/sms-settings-form.tsx b/components/dashboard/sms-settings-form.tsx index 34cdb84..5692c3e 100644 --- a/components/dashboard/sms-settings-form.tsx +++ b/components/dashboard/sms-settings-form.tsx @@ -15,9 +15,9 @@ import { FormLabel, FormMessage, } from "@/components/ui/form" -import { Card, CardContent, CardDescription, CardHeader, CardTitle, CardFooter } from "@/components/ui/card" +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { toast } from "sonner" -import { Loader2, Smartphone, Send } from "lucide-react" +import { Loader2, Send } from "lucide-react" import { updateSmsSettings, sendTestSms } from "@/lib/sms/actions" const smsSettingsSchema = z.object({ diff --git a/components/ui/phone-input.tsx b/components/ui/phone-input.tsx index cb3f7f7..b6ff76d 100644 --- a/components/ui/phone-input.tsx +++ b/components/ui/phone-input.tsx @@ -6,6 +6,7 @@ export interface PhoneInputProps extends React.ComponentProps className?: string } +// eslint-disable-next-line @typescript-eslint/no-explicit-any const PhoneInputComponent = React.forwardRef(({ className, ...props }, ref) => { return ( (({ className, numberInputProps={{ className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", }} + // eslint-disable-next-line @typescript-eslint/no-explicit-any {...(props as any)} /> ) diff --git a/lib/sms/actions.ts b/lib/sms/actions.ts index b71c6fd..98ed9fd 100644 --- a/lib/sms/actions.ts +++ b/lib/sms/actions.ts @@ -58,7 +58,12 @@ export async function updateSmsSettings(data: { // Check if exists const { data: existing } = await supabaseAdmin.from('sms_settings').select('id').single() - const updates: any = { + const updates: { + username: string + header: string + updated_at: string + password?: string + } = { username: data.username, header: data.header, updated_at: new Date().toISOString()