fixes
This commit is contained in:
parent
3a247d6ce1
commit
e9462a5dda
|
@ -9,10 +9,10 @@ if TYPE_CHECKING:
|
|||
|
||||
class Archive_SetAction(Resource):
|
||||
def post(self):
|
||||
data = request.json
|
||||
data = request.get_json()
|
||||
|
||||
try:
|
||||
bypass = "allow_override" in data and data["allow_override"]
|
||||
bypass = ("allow_override" in data) and data["allow_override"]
|
||||
action = data["action_taken"]
|
||||
if "id_str" in data:
|
||||
id = int(data["id_str"])
|
||||
|
@ -23,6 +23,8 @@ class Archive_SetAction(Resource):
|
|||
except Exception as e:
|
||||
print(e)
|
||||
response = app.response_class(response=e, status=400)
|
||||
response.headers.add("Access-Control-Allow-Origin", "*")
|
||||
return response
|
||||
|
||||
db : Database = app.databases["Archive"]
|
||||
query = f"UPDATE x_posts SET action_taken = {action} WHERE id = {id}"
|
||||
|
|
Loading…
Reference in New Issue