forked from React-Group/interstellar_ai
fixed some backend and database stuff
This commit is contained in:
parent
7c2f179c8b
commit
e594ecd7c2
6 changed files with 567 additions and 525 deletions
|
@ -97,6 +97,7 @@ class API:
|
|||
@self.app.route('/interstellar_ai/db', methods=['POST'])
|
||||
def db_manipulate():
|
||||
sent_data = request.get_json()
|
||||
print(sent_data)
|
||||
action = sent_data.get('action')
|
||||
if action == "create_account":
|
||||
return jsonify({'status': 200, 'response': self.db.add_user(sent_data)})
|
||||
|
@ -110,6 +111,10 @@ class API:
|
|||
return jsonify({'status': 200, 'response': self.db.check_credentials(sent_data)})
|
||||
elif action == "delete_account":
|
||||
return jsonify({'status': 200, 'response': self.db.delete_user(sent_data)})
|
||||
elif action == "get_email":
|
||||
return jsonify({'status': 200, 'response': self.db.get_email(sent_data)})
|
||||
elif action == "get_name":
|
||||
return jsonify({'status': 200, 'response': self.db.get_name(sent_data)})
|
||||
|
||||
return jsonify({'status': 401, 'response': "Invalid action"})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue