Skip to content

Commit

Permalink
chore: add typing information
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Jan 11, 2024
1 parent 9fdfdcd commit cc5e383
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def get_product_by_id(db: Session, id: int):
return db.query(Product).filter(Product.id == id).first()


def get_product_by_code(db: Session, code: str):
def get_product_by_code(db: Session, code: str) -> Product:
return db.query(Product).filter(Product.code == code).first()


Expand Down
2 changes: 1 addition & 1 deletion app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def normalize_product_fields(product: JSONType) -> JSONType:
return product


def fetch_product_openfoodfacts_details(product: ProductBase):
def fetch_product_openfoodfacts_details(product: ProductBase) -> JSONType | None:
product = {}
try:
response = openfoodfacts_product_search(code=product.code)
Expand Down

0 comments on commit cc5e383

Please sign in to comment.