Skip to content

Commit a73092c

Browse files
committed
deduped technologies
1 parent 9924880 commit a73092c

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

Diff for: README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ Returns a JSON object with the following schema:
246246

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

249-
- `client` (optional): A string with the client: `mobile` or `desktop`.
250249
- `technology` (optional): A comma-separated string representing the technology name(s) or `ALL`.
251250
- `category` (optional): A comma-separated string representing the category name(s).
252251
- `onlyname` (optional): No value required. If present, only the technology names will be returned.
@@ -255,7 +254,7 @@ The following parameters can be used to filter the data:
255254

256255
```bash
257256
curl --request GET \
258-
--url 'https://{{HOST}}/v1/technologies?category=Live%20chat%2C%20blog&technology=Smartsupp&client=mobile'
257+
--url 'https://{{HOST}}/v1/technologies?category=Live%20chat%2C%20blog&technology=Smartsupp'
259258
```
260259

261260
Returns a JSON object with the following schema:
@@ -266,7 +265,10 @@ Returns a JSON object with the following schema:
266265
"client": "mobile",
267266
"similar_technologies": null,
268267
"description": "Smartsupp is a live chat tool that offers visitor recording feature.",
269-
"origins": 25649,
268+
"origins": {
269+
"desktop": 22178,
270+
"mobile": 25649
271+
},
270272
"technology": "Smartsupp",
271273
"category": "Live chat"
272274
}

Diff for: functions/technologies/libs/presenters.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ class Presenters:
33
@staticmethod
44
def technology(item):
55
return {
6-
'client': item['client'],
76
'similar_technologies': item['similar_technologies'],
87
'description': item['description'],
98
'origins': item['origins'],

Diff for: functions/technologies/libs/queries.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,10 @@ def list_data(params):
2929
filter=FieldFilter("category_obj", "array_contains_any", params_array)
3030
)
3131

32-
if "client" in params:
33-
query = query.where(filter=FieldFilter("client", "==", params["client"]))
34-
3532
documents = query.stream()
3633
data = []
3734

38-
if "onlyname" in params and "client" not in params:
35+
if "onlyname" in params:
3936
appended_tech = set()
4037
for doc in documents:
4138
tech = doc.get("technology")

Diff for: functions/technologies/libs/validator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def validate(self):
1313
# self.add_error("technology", "missing technology parameter")
1414

1515
return Result(errors=self.errors, result=self.params)
16-
16+
1717
def add_error(self, key, error):
1818
self.errors.append([key, error])
1919

0 commit comments

Comments
 (0)