Add POST endpoint for products

This commit is contained in:
Backend IM Bot 2025-03-29 22:53:33 +01:00
parent 5ab0754390
commit 7b2c6ff0e2

View File

@ -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