blob: 3adb013ba7aec3a9ac9e2912ab7d78a5b3902a06 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
from flask import Blueprint, request
from db import cursor, connection
from hierarchy import auth_required
import json
status = Blueprint('user_status', __name__)
@status.route('/status', methods = ['POST'])
@auth_required("user")
def index(user_id):
data = request.get_json()
status = data.get("status") or ""
if not status: return "", 400
cursor.execute("update users set status = ? where user_id = ?", [status[0:200], user_id])
connection.commit()
return "", 200
dynamic_route = ["/user", status]
|