From fde1c84ecbded45c33b8e736cf37ee14b5a72948 Mon Sep 17 00:00:00 2001 From: Kenan KARAER Date: Tue, 27 Jan 2026 23:40:10 +0300 Subject: [PATCH] user eklleme --- components/dashboard/user-form.tsx | 9 +++++++-- components/dashboard/users-table.tsx | 4 +--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/components/dashboard/user-form.tsx b/components/dashboard/user-form.tsx index 21db539..8dc1006 100644 --- a/components/dashboard/user-form.tsx +++ b/components/dashboard/user-form.tsx @@ -1,7 +1,7 @@ "use client" import { useState } from "react" -import { useRouter } from "next/navigation" +import { useRouter, useSearchParams } from "next/navigation" import { useForm } from "react-hook-form" import { zodResolver } from "@hookform/resolvers/zod" import * as z from "zod" @@ -77,6 +77,8 @@ interface UserFormProps { export function UserForm({ initialData, mode = "admin" }: UserFormProps) { const router = useRouter() + const searchParams = useSearchParams() + const returnTo = searchParams.get("returnTo") const [loading, setLoading] = useState(false) const form = useForm({ @@ -140,7 +142,10 @@ export function UserForm({ initialData, mode = "admin" }: UserFormProps) { ) router.refresh() - if (mode === "admin") { + router.refresh() + if (returnTo) { + router.push(returnTo) + } else if (mode === "admin") { router.push("/dashboard/users") } } catch { diff --git a/components/dashboard/users-table.tsx b/components/dashboard/users-table.tsx index 17fb6b8..57d55a3 100644 --- a/components/dashboard/users-table.tsx +++ b/components/dashboard/users-table.tsx @@ -28,11 +28,9 @@ export function UsersTable({ users }: UsersTableProps) {

Kullanıcı Listesi

- {/* - + - */}