mirror of
http://88.130.71.182:3000/BlitTech/badoHair_be.git
synced 2026-06-13 08:34:29 +00:00
16 lines
461 B
Python
16 lines
461 B
Python
from fastapi import APIRouter, Depends
|
|
import asyncpg
|
|
|
|
from app.core.responses import ok
|
|
from app.dependencies import get_db
|
|
|
|
router = APIRouter(prefix="/services", tags=["Services"])
|
|
|
|
|
|
@router.get("")
|
|
async def list_services(db: asyncpg.Connection = Depends(get_db)):
|
|
rows = await db.fetch(
|
|
"SELECT id, name, description, duration_minutes, price FROM services WHERE is_active = true ORDER BY price ASC"
|
|
)
|
|
return ok([dict(r) for r in rows])
|