Fix
This commit is contained in:
@ -190,14 +190,16 @@ def show_list(
|
|||||||
return modifier_categories
|
return modifier_categories
|
||||||
|
|
||||||
|
|
||||||
@router.get("/for-product/{id_}")
|
@router.get("/for-product/{sku_id}")
|
||||||
def for_product(
|
def for_product(
|
||||||
id_: uuid.UUID,
|
sku_id: uuid.UUID,
|
||||||
date_: date = Depends(effective_date),
|
date_: date = Depends(effective_date),
|
||||||
user: UserToken = Security(get_user),
|
user: UserToken = Security(get_user),
|
||||||
) -> list[ModifierCategoryForProduct]:
|
) -> list[ModifierCategoryForProduct]:
|
||||||
with SessionFuture() as db:
|
with SessionFuture() as db:
|
||||||
product: Product = db.execute(select(Product).where(Product.id == id_)).scalar_one()
|
product: Product = db.execute(
|
||||||
|
select(Product).join(Product.skus).where(StockKeepingUnit.id == sku_id)
|
||||||
|
).scalar_one()
|
||||||
|
|
||||||
return [
|
return [
|
||||||
ModifierCategoryForProduct(
|
ModifierCategoryForProduct(
|
||||||
|
|||||||
Reference in New Issue
Block a user