You've already forked KemoFureApi
							
							fixes
This commit is contained in:
		| @@ -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}" | ||||
| @@ -32,9 +34,9 @@ class Archive_SetAction(Resource): | ||||
|         result = db.db.run_command(query) | ||||
|  | ||||
|         response = app.response_class( | ||||
|             response=result, | ||||
|             response=str(result), | ||||
|             status=200, | ||||
|             mimetype='application/json' | ||||
|             mimetype='text/plain' | ||||
|         ) | ||||
|  | ||||
|         response.headers.add("Access-Control-Allow-Origin", "*") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user