Skip to content

Commit 72410e2

Browse files
committed
readme update
1 parent c58a75f commit 72410e2

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

README.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ This endpoint can return a full list of categories names or a categories with al
5151

5252
The following parameters can be used to filter the data:
5353

54-
- `category` (`required`): A comma-separated string representing the category name(s).
55-
- `onlyname` (optional): A string 'true' or 'false'.
54+
- `category` (optional): A comma-separated string representing the category name(s).
55+
- `onlyname` (optional): No value required. If present, only the category names will be returned.
5656

5757
#### Response
5858

@@ -245,18 +245,16 @@ Returns a JSON object with the following schema:
245245

246246
The following parameters can be used to filter the data:
247247

248-
- `technology` (`required`): A comma-separated string representing the technology name(s).
249-
- `start` (optional): A string representing the start date in the format `YYYY-MM-DD`.
250-
- `end` (optional): A string representing the end date in the format `YYYY-MM-DD`.
251-
- `geo` (optional): A string representing the geographic location.
252-
- `rank` (optional): An string representing the rank.
248+
- `client` (optional): A string with the client: `mobile` or `desktop`.
249+
- `technology` (optional): A comma-separated string representing the technology name(s) or `ALL`.
253250
- `category` (optional): A comma-separated string representing the category name(s).
251+
- `onlyname` (optional): No value required. If present, only the technology names will be returned.
254252

255253
#### Response
256254

257255
```bash
258256
curl --request GET \
259-
--url 'https://{{HOST}}/v1/technologies?start=2022-02-01&end=2022-04-01&category=Live%20chat%2C%20blog&technology=Smartsupp&client=mobile'
257+
--url 'https://{{HOST}}/v1/technologies?category=Live%20chat%2C%20blog&technology=Smartsupp&client=mobile'
260258
```
261259

262260
Returns a JSON object with the following schema:

functions/categories/libs/queries.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
from google.cloud import firestore
33
from google.cloud.firestore_v1.base_query import FieldFilter
4-
from .result import Result
4+
from .result import Result
55
from .utils import convert_to_array
66

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

functions/technologies/libs/queries.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,13 @@ def list_data(params):
4848
if onlyname and 'client' not in params:
4949
appended_technologies = set()
5050
for doc in documents:
51-
item = doc.to_dict()
52-
technology = item['technology']
51+
technology = doc.get('technology')
5352
if technology not in appended_technologies:
5453
appended_technologies.add(technology)
5554
data.append(technology)
5655

5756
else:
5857
for doc in documents:
59-
item = doc.to_dict()
60-
data.append(Presenters.technology(item))
58+
data.append(Presenters.technology(doc.to_dict()))
6159

6260
return Result(result=data)

0 commit comments

Comments
 (0)