From 82fa214751bb8c04620b1359a03b478407fcc002 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Sun, 30 Mar 2025 08:33:40 +0100 Subject: [PATCH] Add POST endpoint for products --- endpoints/products.post.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 endpoints/products.post.py diff --git a/endpoints/products.post.py b/endpoints/products.post.py new file mode 100644 index 0000000..891feeb --- /dev/null +++ b/endpoints/products.post.py @@ -0,0 +1,10 @@ +from fastapi import APIRouter, Depends, status +from schemas.product import ProductCreate +from helpers.product_helpers import create_product + +router = APIRouter() + +@router.post("/products", status_code=status.HTTP_201_CREATED) +async def add_product(product: ProductCreate): + new_product = create_product(product) + return new_product \ No newline at end of file