How to use the @inertiajs/inertia.Inertia.post 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 / user / Forms / Profile.tsx View on Github external
const onDrop = useCallback((acceptedFiles) => {
    const selectFile = acceptedFiles[0];
    setPicture(URL.createObjectURL(selectFile));

    // Upload file to the server.
    const formData = new FormData();
    formData.append('avatar_location', selectFile);
    Inertia.post(`/profile/avatar`, formData);
  }, []);
  const inputClass = classNames('form-input flex-1 block w-full focus:shadow-outline-brand focus:border-brand-200 rounded-none rounded-r-md transition duration-150 ease-in-out sm:text-sm sm:leading-5', {
github laravelcm / website / resources / assets / ts / pages / forum / ThreadModal.tsx View on Github external
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 / auth / Register.tsx View on Github external
function handleSubmit(e: React.SyntheticEvent) {
    e.preventDefault();
    if (!isRobot) {
      setSending(true);
      Inertia.post("/register", values).then(() => {
        setSending(false);
      });
    }
  }
github laravelcm / website / resources / assets / ts / pages / auth / Email.tsx View on Github external
function handleSubmit(e: React.SyntheticEvent) {
    e.preventDefault();
    setSending(true);
    Inertia.post("/password/email", { email }).then(() => {
      setSending(false);
      setEmail("");
    });
  }
github laravelcm / website / resources / assets / ts / pages / auth / Login.tsx View on Github external
function handleSubmit(e: React.SyntheticEvent) {
    e.preventDefault();
    setSending(true);
    Inertia.post("/login", values).then(() => {
      setSending(false);
    });
  }
github laravelcm / website / resources / assets / ts / pages / auth / Reset.tsx View on Github external
function handleSubmit(e: React.SyntheticEvent) {
    e.preventDefault();
    setSending(true);
    Inertia.post("/password/reset", values).then(() => {
      setSending(false);
    });
  }
github laravelcm / website / resources / assets / ts / components / forum / Reply.tsx View on Github external
function markBestReply(e: React.SyntheticEvent, replyId: number) {
    e.preventDefault();
    Inertia.post(`/forum/threads/replies/${replyId}/best`);
  }

@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