Skip to content

Commit

Permalink
bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarocosta committed Mar 11, 2020
1 parent 87105c1 commit b13b6e7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Routes/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@


def getNode(__class, uid):

try:
node = __class.nodes.get(uid=uid)
return node.toJSON()
return __class.nodes.get(uid=uid)
except:
return None

Expand Down Expand Up @@ -61,28 +59,30 @@ def responseDefault():


@app.route("/<node_type>/<uid>", methods=["GET"])
def view(node_type, uid):
# try:
def responseGetNode(node_type, uid):
result = switchNodes(node_type, uid)
if result is not None:
return Response(result, mimetype="application/json", status=200)
return Response(result.toJSON(), mimetype="application/json", status=200)
else:
return Response("Node Does Not exists", status=400)


@app.route("/schema/<uid>", methods=["GET"])
def getSchema(uid):
returned_string = String.nodes.get(uid=uid)
return jsonify(returned_string.getSchema())
@app.route("/schema/<node_type>/<uid>", methods=["GET"])
def responseGetSchemaNode(node_type, uid):
result = switchNodes(node_type, uid)
if result is not None:
return jsonify(result.getSchema())
else:
return Response("Node Does Not exists", status=400)


@app.route("/create")
@app.route("/create", methods=["POST"])
def create():
return "create"


# update node
@app.route("/<node_type>/<uid>", methods=["Post"])
@app.route("/<node_type>/<uid>", methods=["POST"])
def update(node_type, uid):
return "update %s" % uid

Expand Down

0 comments on commit b13b6e7

Please sign in to comment.