2020-03-23 21:17:16 +01:00
|
|
|
from flask import request, jsonify
|
|
|
|
from database import register_user
|
|
|
|
from external.twilio import send_otp
|
|
|
|
from app import app
|
|
|
|
|
|
|
|
|
|
|
|
@app.route("/users", methods=["POST"])
|
2020-04-02 19:33:04 +02:00
|
|
|
def create_user():
|
2020-03-23 21:17:16 +01:00
|
|
|
data = request.get_json()
|
|
|
|
register_user(data)
|
|
|
|
send_otp(data["mobile"])
|
|
|
|
return jsonify("User created, pending OTP verification")
|