mirror of
http://88.130.71.182:3000/BlitTech/badoHair_be.git
synced 2026-06-12 23:23:22 +00:00
Initial Commit
This commit is contained in:
15
app/routers/services.py
Normal file
15
app/routers/services.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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])
|
||||
Reference in New Issue
Block a user