Skip to content

Commit

Permalink
client params query
Browse files Browse the repository at this point in the history
  • Loading branch information
maceto committed Nov 16, 2024
1 parent 1896154 commit f0429cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion functions/technologies/libs/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from .utils import convert_to_array
from .presenters import Presenters


DB = firestore.Client(project=os.environ.get('PROJECT'), database=os.environ.get('DATABASE'))

def list_data(params):
Expand All @@ -30,6 +29,9 @@ def list_data(params):
params_array = convert_to_array(params['category'])
query = query.where(filter=FieldFilter('category_obj', 'array_contains_any', params_array))

if 'client' in params:
query = query.where(filter=FieldFilter('client', '==', params['client']))

if 'onlyname' in params:
onlyname = True

Expand Down

0 comments on commit f0429cb

Please sign in to comment.