Madras1 commited on
Commit
42f2840
·
verified ·
1 Parent(s): 43e23ba

Upload 61 files

Browse files
Files changed (1) hide show
  1. app/api/routes/entities.py +4 -0
app/api/routes/entities.py CHANGED
@@ -17,6 +17,7 @@ router = APIRouter(prefix="/entities", tags=["Entities"])
17
  def list_entities(
18
  type: Optional[str] = None,
19
  search: Optional[str] = None,
 
20
  limit: int = Query(default=50, le=200),
21
  offset: int = 0,
22
  db: Session = Depends(get_db)
@@ -24,6 +25,9 @@ def list_entities(
24
  """Lista todas as entidades com filtros opcionais"""
25
  query = db.query(Entity)
26
 
 
 
 
27
  if type:
28
  query = query.filter(Entity.type == type)
29
 
 
17
  def list_entities(
18
  type: Optional[str] = None,
19
  search: Optional[str] = None,
20
+ project_id: Optional[str] = None,
21
  limit: int = Query(default=50, le=200),
22
  offset: int = 0,
23
  db: Session = Depends(get_db)
 
25
  """Lista todas as entidades com filtros opcionais"""
26
  query = db.query(Entity)
27
 
28
+ if project_id:
29
+ query = query.filter(Entity.project_id == project_id)
30
+
31
  if type:
32
  query = query.filter(Entity.type == type)
33