I am trying to figure out how can I implement a HTTP patch in my application. I have never used it before. I use Express.js and sequelize (MySQL).
I looked on SO and on internet for real life example, but could not find anything of real value. Those links gave me better understanding what is PATCH, but I still fail to see its benefit in my case. It must be something I am missing.
This is my simplified setup:
router:
basePath:
controller: PutUser
method: PUT
path: /user/:userId/
Payload:
{email: 'newemail@hello.com'}
Controller:
Then here I find the user by its id and give the payload. User gets updated
What is confusing me, is if I were to implement a PATCH, the only things that changes is in router, I use PATCH instead. I also use userId to find the user and change its email. What am I missing? Is this how it is supposed to be?