How to use the @inertiajs/inertia.Inertia.put function in @inertiajs/inertia

To help you get started, we’ve selected a few @inertiajs/inertia examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github laravelcm / website / resources / assets / ts / pages / forum / ThreadModal.tsx View on Github external
function manageThread(e: React.SyntheticEvent) {
    e.preventDefault();
    setSending(true);

    const form = {
      ...values,
      body,
    };

    if (thread) {
      Inertia.put(`/forum/threads/${id}`, form).then(() => {
        setSending(false);
        onClose();
        window.location.reload();
      }).catch((error) => {
        console.error(error);
      });
    } else {
      Inertia.post(`/forum/threads`, form).then(() => {
        setSending(false);
      }).catch((error) => {
        console.error(error);
      });
    }
  }
github laravelcm / website / resources / assets / ts / pages / user / Forms / Profile.tsx View on Github external
function handleSubmit(e: React.SyntheticEvent) {
    e.preventDefault();
    setSending(true);
    Inertia.put('/profile/profile', values).then(() => {
      setSending(false);
    });
  }
github laravelcm / website / resources / assets / ts / pages / user / Forms / PersonalData.tsx View on Github external
function handleSubmit(e: React.SyntheticEvent) {
    e.preventDefault();
    setSending(true);
    const data = {
      ...values,
      ...locations,
    };

    Inertia.put('/profile/update', data).then(() => {
      setSending(false);
    });
  }

@inertiajs/inertia

A framework for creating server-driven single page apps.

MIT
Latest version published 2 years ago

Package Health Score

66 / 100
Full package analysis

Similar packages