master
Aevann1 2021-09-25 20:19:00 +02:00
parent 08fb1a76fb
commit 293cd4cca0
1 changed files with 3 additions and 2 deletions

View File

@ -209,8 +209,9 @@ def subscribe(v, post_id):
@auth_required
def unsubscribe(v, post_id):
sub=g.db.query(Subscription).options(lazyload('*')).filter_by(user_id=v.id, submission_id=post_id).first()
g.db.delete(sub)
g.db.commit()
if sub:
g.db.delete(sub)
g.db.commit()
return {"message": "Post unsubscribed!"}
@app.post("/@<username>/message")