Commit 13e400ca authored by dsbenton's avatar dsbenton
Browse files

Merge branch 'dejanae_omega2' into 'main'

Dejanae omega2

See merge request !4
parents f6f7872f 12883cf8
......@@ -151,15 +151,16 @@ def validate_login():
return jsonify(False)
@ app.route('/message', methods=["POST"])
@ app.route('/vue-admin-template/user/form', methods=["POST"])
def send_messages():
"""Send messages to different users."""
connection = get_db()
message = flask.request.json["form"]["message"]
# add into database somehow
file_list = flask.request.json["form"]["fileList"]
sender = flask.session["username"]
receiver = flask.request.json["receiver"]
data = request.get_json()
message = data["message"]
# file_list = data["form"]["fileList"]
sender = data["username"]
receiver = data["receiver"]
connection.execute(
"INSERT INTO messages (?, ?, ?)",
......@@ -169,7 +170,7 @@ def send_messages():
return
@ app.route('/message', methods=["GET"])
@ app.route('/vue-admin-template/user/form', methods=["GET"])
def receive_messages():
"""Receive messages from different messages."""
connection = get_db()
......@@ -186,7 +187,9 @@ def receive_messages():
for message in messages:
m = {
"message": message["text"],
"fileList": [message["filename"]]
"fileList": [message["filename"]],
"sender": message["sender"],
"receiver": message["receiver"]
}
return_messages.append(m)
context = {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment