Skip to content

Commit

Permalink
API: Fixed version api bug
Browse files Browse the repository at this point in the history
-typos
-sqla objects refactor
  • Loading branch information
AuxiliumCDNG committed Jan 26, 2022
1 parent a172fbf commit cc36469
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from routes.permissions import api_permissions
from statics import config

app.config["environment"] = "development"
app.debug = True

init.init_db()

Expand Down
8 changes: 4 additions & 4 deletions routes/api_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def get_content():

################## UPDATING CONTENT IF VERSION ID IS SPECIFIED ##################
if "version" in request.args.keys():
version = session.query(db.Versions).filter_by(id=request.args["verions"]).first()
version = session.query(db.Versions).filter_by(id=request.args["version"]).first()

if str(current["id"]) != str(version["content_id"]):
if str(current["id"]) != str(version.content_id):
return {"error": {"message": "version id not found for this post!"}}, 409
current["name"] = version["name"]
current["content"] = version["content"]
current["name"] = version.name
current["content"] = version.content

################## SETTING SUBCOMMENT AMOUNT ##################
if current["type"] == "comment":
Expand Down

0 comments on commit cc36469

Please sign in to comment.