import React from 'react'; import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout'; import { Head, useForm } from '@inertiajs/react'; import { toast } from 'react-toastify'; export default function Dashboard(props) { const { settings } = props const setting = settings.find(s => s.key === 'DESTINATION_MAIL' ) const { data, setData, post, processing, errors } = useForm({ email: setting.value, }) const handleOnChange = (event) => { setData(event.target.name, event.target.type === 'checkbox' ? event.target.checked : event.target.value); } const handleSubmit = () => { post(route('setting.update'), { onSuccess: () => Promise.all([ toast.success('The Data has been saved'), ]), }) } const handleSubmitAndTest = () => { post(route('setting.update', { test: 'test' }), { onSuccess: () => Promise.all([ toast.success('The Data has been saved'), ]), }) } return (
Simpan
Simpan & Test
); }