Fixed a variable

This commit is contained in:
2024-06-20 10:43:53 -04:00
parent 11b023cd2b
commit 187588d3ae
4 changed files with 85 additions and 3 deletions

31
app/routers/customer.py Normal file
View File

@@ -0,0 +1,31 @@
from fastapi import APIRouter
from app.database import session
import os
from app.models.customer import Customer_Customer
router = APIRouter(
prefix="/customer",
tags=["customer"],
responses={404: {"description": "Not found"}},
)
@router.get("/{user_id}")
async def get_customer(user_id):
get_the_customer = (session.query(Customer_Customer)
.filter(Customer_Customer.id == user_id)
.first())
return {
"ok": True,
"customer_phone_number": get_the_customer.customer_phone_number,
"customer_first_name": get_the_customer.customer_first_name,
"customer_last_name": get_the_customer.customer_last_name,
"account_number": get_the_customer.account_number,
}