python - Restoring soft_delete using PATCH results in 422 unknown field "_deleted" -


playing around soft_deletes in python-eve 0.6 , setup function restore delete, i'm 422 (unprocessable entity) error {"_status": "err", "_issues": {"_deleted": "unknown field"}}

this json response get

{   "_updated": "tue, 02 jun 2015 23:58:50 gmt",   "_latest_version": 2,   "_error": {     "message": "the requested url not found on server.",     "code": 404   },   "title": "kimberli dygert",   "_version": 2,   "_deleted": true,   "_links": {     "self": {       "href": "items\/556cdaf4ee67bd0717181826",       "title": "item"     }   },   "_created": "mon, 01 jun 2015 22:21:40 gmt",   "_status": [     "err"   ],   "_id": "556cdaf4ee67bd0717181826",   "_etag": "d48684051f506ea70590682d1705f18a74faea2f" } 

and function i'm using try restore soft_delete

this.restore = function (id, etag) {     var req = {         method: 'patch',         url: urlbase + '/' + id,         headers: {             //'content-type': 'application/json',             'if-match': etag         },         data: { '_deleted': false  }     };     return $http(req); }; 

like _etag or _updated , _created fields, _deleted special meta field managed eve. clients aren't expected edit field directly, , don't need in order restore soft deleted document. valid patch (or put) requests made soft deleted documents automatically restore document, , eve updates _deleted field accordingly. remove '_deleted': false patch request, , document restore expected.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -