node-restful icon indicating copy to clipboard operation
node-restful copied to clipboard

Patch method support

Open Satak opened this issue 9 years ago • 5 comments

Does node-restful support 'Patch' REST method?

Satak avatar Feb 23 '16 10:02 Satak

Sadly, it looks like that's not yet implemented:

https://github.com/baugarten/node-restful/blob/d5277ae484cfb43ddb71dd97580a6989ca281e76/lib/model.js#L8

manicExpressive avatar Feb 25 '16 05:02 manicExpressive

This is true

baugarten avatar Feb 25 '16 16:02 baugarten

But if you only send the property you want to change via put, it only chages it and persist the other ones

camilomontoyau avatar Mar 01 '16 20:03 camilomontoyau

Currently PATCH is supported but it's called PUT, PUT should actually override the whole object with the new one that's provided whereas PATCH should only change the field you provide. It looks like @baugarten got these backwards.

OmgImAlexis avatar Jan 28 '17 02:01 OmgImAlexis

If you guys want to try this out I've opened a PR to possibly fix this. Ref: https://github.com/baugarten/node-restful/pull/152

OmgImAlexis avatar Jan 28 '17 02:01 OmgImAlexis