Loan insert

This commit is contained in:
CHIEFSOFT\ameye
2025-02-17 14:37:05 -05:00
parent 137427c9a5
commit 955e5429b0
+6 -1
View File
@@ -293,9 +293,14 @@ def salary_loanapply2():
if loan != '' and bvn != '' and amount > 0 :
loan = load_offer(loan,bvn)
INSERT_LOAN ="INSERT INTO loan_apply (loan, bvn, amount) VALUES(%s, %s, %s)"
new_data = (loan,bvn, amount)
with connection:
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
cursor.execute(INSERT_LOAN, new_data)
return {
"message": "REQUEST_PIN",
"loan": loan,
"loan_application_id": '70581361-c2ec-4d6a-93f0-d5c0f2516a00',
"active_loan_count": 0,
"active_loan": []
}, 201