同步更新likenum

This commit is contained in:
2020-09-08 15:32:54 +08:00
parent 77ea7c3b01
commit a3fc72537e

View File

@@ -197,6 +197,7 @@ def get_comment():
return {
'code': 0,
'attention': check_attention(u.name, pid),
'likenum': post.likenum,
'data': data
}
@@ -255,7 +256,11 @@ def attention():
post.likenum += 1 - 2 * int(s == '0');
db.session.commit()
return {'code': 0}
return {
'code': 0,
'likenum': post.likenum,
'attention': (s=='1')
}
@app.route('/_api/v1/getattention')
def get_attention():