Hello, I am trying to update a resource using patch method. I am completely unable to do so. I am using only node and no react.
I have to update the desc field. my backend patch request is working. The code for patch request is

At postman it is working fine
you can see the record in the dB is updated
I need to update it through a form having a text area.
I have attached a function in my frontend JavaScript to the submit button for creating a fetch request
Below is my Form in html.
Here is how the button is linked with the function
This is the error I am getting
Here is my frontend console
My Fetch Request for Patch Javascript Codes
await fetch(window.location.href, {
method: 'PATCH',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
credentials: 'include',
body: JSON.stringify({
desc: abc,
})
})
.then((response) => {
console.log(response);
return response;
})
.then((data) => {
console.log(data);
})
};








