odapi/src/app/routes.py

13 lines
365 B
Python
Raw Normal View History

2020-03-23 21:17:16 +01:00
from flask import request, jsonify
from database.crud import insert_data
2020-03-23 21:17:16 +01:00
from external.twilio import send_otp
from app import app
@app.route("/register", methods=["POST"])
def create_user():
2020-03-23 21:17:16 +01:00
data = request.get_json()
insert_data(schema="Users", data=data)
send_otp(receiver=data["mobile"])
2020-03-23 21:17:16 +01:00
return jsonify("User created, pending OTP verification")