芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/reginaeigbe.com/folder/admin/tmp/resources/js/Admin/Pages/Posts/Edit.jsx
import AdminLayouts from "@/Admin/Layouts/AdminLayouts"; import { Head, useForm } from "@inertiajs/react"; import TextInput from "@/Admin/Components/Inputs/TextInput.jsx"; import Editor from "@/Admin/Components/Inputs/Editor.jsx"; import FromValidationError from "@/Admin/Components/Validation/FromValidationError.jsx"; import CustomSelect from "@/Admin/Components/Inputs/CustomSelect.jsx"; import TagInput from "@/Admin/Components/Inputs/TagInput.jsx"; import FileUpload from "@/Admin/Components/Inputs/FileUpload.jsx"; import DangerButton from "@/Admin/Components/Button/DangerButton.jsx"; import SuccessButton from "@/Admin/Components/Button/SuccessButton.jsx"; export default function Edit({ categories, edited_post }) { const { data, setData, errors, post, processing } = useForm({ _method: "put", category: edited_post.category_id, category_name: "", tags: edited_post.tags, thumbnail_image: null, add_new_category: false, title: edited_post.title, content: edited_post.content, status: edited_post.status, meta_title: edited_post.meta_title, meta_description: edited_post.meta_description, }); // handle update const handleUpdate = (e) => { e.preventDefault(); post(route("admin.posts.update", edited_post)); }; return (
Edit Posts
Post Details
setData("title", e.target.value) } />
Content *
setData("content", data) } />
SEO Details
setData( "meta_title", e.target.value ) } />
setData( "meta_description", e.target.value ) } />
Category
{data.add_new_category ? (
setData( "category_name", e.target.value ) } /> ) : (
setData("category", e) } /> )}
{data.add_new_category ? (
setData( "add_new_category", false ) } > + Select existing category
) : (
setData( "add_new_category", true ) } > + Add new category
)}
Tags
setData("tags", tags) } id="tags" />
Featured image
setData("thumbnail_image", file) } value={edited_post.thumbnail_image_url} />
setData("status", "0")} > UnPublish
setData("status", "1")} > Update
); }