79395218

Date: 2025-01-28 21:26:29
Score: 0.5
Natty:
Report link

Your javascript code just needed a little tweaking. It should look something like this:

    // your previous code
    const formData = new FormData(form);
    const searchParams = new URLSearchParams();
    for (let [key, value] of formData.entries()) {
      searchParams.append(key.toString(), value.toString());
    }
    
    fetch(form.action, {
      method: 'POST',
      body: searchParams.toString(),
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
      },
    })
    // your other code

I just checked with myself, it should work, request.POST should now contain the form data. Check it out and let me know if it works for you?

p.s. I did not use your update_expense controller code.

Reasons:
  • Blacklisted phrase (0.5): Check it out
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Serhii Fomenko