diff options
Diffstat (limited to '')
-rw-r--r-- | umosapi/api.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/umosapi/api.py b/umosapi/api.py index 9379a55..b60b610 100644 --- a/umosapi/api.py +++ b/umosapi/api.py @@ -43,8 +43,8 @@ uobject_model = api.model('UObject', { }) -@api.route('/objects', endpoint='objetcs') -class Objects(Resource): +@api.route('/objects') +class ObjectsList(Resource): def get(self): """ Get uobjects list """ uobjects = uobject.all() @@ -52,9 +52,6 @@ class Objects(Resource): return loads('{"msg": "No uobjects"}'), 404 return sanitize(uobjects), 200 - -@api.route("/objects/register") -class Register(Resource): @api.expect(uobject_model) def post(self): """ Register new uobject """ @@ -68,8 +65,9 @@ class Register(Resource): @api.route("/objects/<_id>") -class Update(Resource): +class Objects(Resource): @api.expect(uobject_model) + @api.doc(params={'_id': '5d244cc13f3d46cb739912ae'}) def patch(self, _id): """ Edit an uobject. """ args = request.get_json(force=True) @@ -78,9 +76,7 @@ class Update(Resource): return {"msg": status['msg']}, status['code'] -@api.route('/objects/<_id>') -@api.doc(params={'_id': '5d244cc13f3d46cb739912ae'}) -class Remove(Resource): + @api.doc(params={'_id': '5d244cc13f3d46cb739912ae'}) def delete(self, _id): """ Remove an uobject """ status = uobject.remove(_id) |