Update 'api/blueprints/common/otp/timed_otp.py'
Update the password in case the client id is specified while verify otp
This commit is contained in:
@@ -359,15 +359,35 @@ async def verify_otp(
|
||||
if phone_no.startswith("254"): phone_no = phone_no[3:]
|
||||
if phone_no.startswith("0"): phone_no = phone_no[1:]
|
||||
phone_no = "+254" + phone_no
|
||||
|
||||
# hit Omkar's API:
|
||||
# if client id is not none then hit update the client add with notes else - add client with notes
|
||||
# 24/03/2025 -client_id = inbound_data.id.get("idClient")
|
||||
if client_id is not None: # hit Omkar's API:
|
||||
api_response = await current_app.http_client.post(
|
||||
url = "https://api.thecaoffice.com/client/add/with/notes",
|
||||
url="https://api.thecaoffice.com/client/update/with/notes",
|
||||
headers={"X-Session-Token": inbound_headers["X-Session-Token"]},
|
||||
json={
|
||||
"email": inbound_data.id.get("email"),
|
||||
"clientName": inbound_data.id.get("clientName"),
|
||||
"address": inbound_data.id.get("address"),
|
||||
"phoneNo": inbound_data.id.get("phoneNo"),
|
||||
"city": inbound_data.id.get("city"),
|
||||
"pincode": inbound_data.id.get("pincode"),
|
||||
"panCard": inbound_data.id.get("panCard"),
|
||||
"gst": inbound_data.id.get("gst"),
|
||||
"entity": inbound_data.id.get("entity"),
|
||||
"country": inbound_data.id.get("country"),
|
||||
"startDate": inbound_data.id.get("startDate"),
|
||||
"period": inbound_data.id.get("period"),
|
||||
"amount": inbound_data.id.get("amount"),
|
||||
"idClient": inbound_data.id.get("idClient"),
|
||||
"username": inbound_data.id.get("username"),
|
||||
"password": inbound_data.id.get("password")
|
||||
} )
|
||||
else: # hit Omkar's API:
|
||||
api_response = await current_app.http_client.post( url = "https://api.thecaoffice.com/client/add/with/notes",
|
||||
headers = {"X-Session-Token": inbound_headers["X-Session-Token"]}, json = {
|
||||
"email": inbound_data.email,
|
||||
"clientName": inbound_data.username,
|
||||
"password": inbound_data.password,
|
||||
"address": None,
|
||||
"phoneNo": phone_no,
|
||||
"city": None,
|
||||
@@ -378,10 +398,31 @@ async def verify_otp(
|
||||
"country": None,
|
||||
"startDate": None,
|
||||
"period": None,
|
||||
"amount": None
|
||||
}
|
||||
"amount": None }
|
||||
)
|
||||
|
||||
# hit Omkar's API:
|
||||
#api_response = await current_app.http_client.post(
|
||||
# url = "https://api.thecaoffice.com/client/add/with/notes",
|
||||
# headers = {"X-Session-Token": inbound_headers["X-Session-Token"]},
|
||||
# json = {
|
||||
# "email": inbound_data.email,
|
||||
# "clientName": inbound_data.username,
|
||||
# "password": inbound_data.password,
|
||||
# "address": None,
|
||||
# "phoneNo": phone_no,
|
||||
# "city": None,
|
||||
# "pincode": None,
|
||||
# "panCard": None,
|
||||
# "gst": None,
|
||||
# "entity": None,
|
||||
# "country": None,
|
||||
# "startDate": None,
|
||||
# "period": None,
|
||||
# "amount": None
|
||||
# }
|
||||
#)
|
||||
|
||||
# ┳┓
|
||||
# ┣┫┏┓┏┏┓┏┓┏┓┏┏┓
|
||||
# ┛┗┗ ┛┣┛┗┛┛┗┛┗
|
||||
|
||||
Reference in New Issue
Block a user