fix/filtros-catalogos
This commit is contained in:
@@ -27,6 +27,14 @@ class ConceptService:
|
||||
Concept.company_id == company_id
|
||||
)
|
||||
|
||||
if filters:
|
||||
if filters.get("code"):
|
||||
query = query.filter(Concept.code.ilike(f"%{filters['code']}%"))
|
||||
if filters.get("description"):
|
||||
query = query.filter(
|
||||
Concept.description.ilike(f"%{filters['description']}%")
|
||||
)
|
||||
|
||||
total = query.count()
|
||||
items = query.offset(skip).limit(limit).all()
|
||||
|
||||
|
||||
@@ -22,8 +22,12 @@ class IdentifierService:
|
||||
)
|
||||
|
||||
if filters:
|
||||
# Add filters here if needed
|
||||
pass
|
||||
if filters.get("code"):
|
||||
query = query.filter(Identifier.code.ilike(f"%{filters['code']}%"))
|
||||
if filters.get("description"):
|
||||
query = query.filter(
|
||||
Identifier.description.ilike(f"%{filters['description']}%")
|
||||
)
|
||||
|
||||
total = query.count()
|
||||
items = query.offset(skip).limit(limit).all()
|
||||
|
||||
@@ -27,8 +27,12 @@ class LegendService:
|
||||
)
|
||||
|
||||
if filters:
|
||||
# Add filters here if needed
|
||||
pass
|
||||
if filters.get("code"):
|
||||
query = query.filter(Legend.code.ilike(f"%{filters['code']}%"))
|
||||
if filters.get("description"):
|
||||
query = query.filter(
|
||||
Legend.description.ilike(f"%{filters['description']}%")
|
||||
)
|
||||
|
||||
total = query.count()
|
||||
items = query.offset(skip).limit(limit).all()
|
||||
|
||||
Reference in New Issue
Block a user