diff --git a/API/route.py b/API/route.py index dd51905..bb0b34d 100644 --- a/API/route.py +++ b/API/route.py @@ -12,7 +12,6 @@ from fastapi import APIRouter, HTTPException, Response from matplotlib import pyplot as plt from PIL import Image -from pydantic import BaseModel from API.database import Database from API.utils import init_logging_config @@ -21,11 +20,13 @@ router = APIRouter() + client = Database() + collection = "faceEntries" -# Models for the data to be sent and received by the server +# Models for the data to be sent and received by the server class Employee(BaseModel): EmployeeCode: int Name: str @@ -103,7 +104,7 @@ async def create_new_faceEntry(Employee: Employee): # To display all records -@router.get("/Data/", response_model=List[Employee]) +@router.get("/Data/", response_model=list[Employee]) async def get_employees(): """ Retrieve a list of employees from the database.