芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/reginaeigbe.com/folder/admin/tmp/resources/js/Admin/Pages/Users/Edit.jsx
import AdminLayouts from "@/Admin/Layouts/AdminLayouts"; import TextInput from "@/Admin/Components/Inputs/TextInput.jsx"; import { useForm, Head } from "@inertiajs/react"; import { useEffect } from "react"; export default function Edit({ roles, user }) { const { data, setData, errors, put, processing } = useForm({ name: user.name, email: user.email, about: user.about, role: user.role_name, password: "", }); // handle publish const handlePublish = (e) => { e.preventDefault(); put(route("admin.users.update", user)); }; return (
Edit user
User Details
setData("name", e.target.value) } />
setData("email", e.target.value) } />
setData("password", e.target.value) } />
setData("about", e.target.value) } />
setData( "role", e.target.value ) } value={data.role} >
Select Role
{roles.map((role, index) => (
{role.title}
))}
{errors.role && (
{errors.role}
)}
Update
); }