diff --git a/README.md b/README.md index 9cf62fc..d9ebe98 100644 --- a/README.md +++ b/README.md @@ -246,7 +246,6 @@ Returns a JSON object with the following schema: The following parameters can be used to filter the data: -- `client` (optional): A string with the client: `mobile` or `desktop`. - `technology` (optional): A comma-separated string representing the technology name(s) or `ALL`. - `category` (optional): A comma-separated string representing the category name(s). - `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: ```bash curl --request GET \ - --url 'https://{{HOST}}/v1/technologies?category=Live%20chat%2C%20blog&technology=Smartsupp&client=mobile' + --url 'https://{{HOST}}/v1/technologies?category=Live%20chat%2C%20blog&technology=Smartsupp' ``` Returns a JSON object with the following schema: @@ -266,7 +265,10 @@ Returns a JSON object with the following schema: "client": "mobile", "similar_technologies": null, "description": "Smartsupp is a live chat tool that offers visitor recording feature.", - "origins": 25649, + "origins": { + "desktop": 22178, + "mobile": 25649 + }, "technology": "Smartsupp", "category": "Live chat" } diff --git a/functions/technologies/libs/presenters.py b/functions/technologies/libs/presenters.py index c4b03bf..132dd1b 100644 --- a/functions/technologies/libs/presenters.py +++ b/functions/technologies/libs/presenters.py @@ -3,7 +3,6 @@ class Presenters: @staticmethod def technology(item): return { - 'client': item['client'], 'similar_technologies': item['similar_technologies'], 'description': item['description'], 'origins': item['origins'], diff --git a/functions/technologies/libs/queries.py b/functions/technologies/libs/queries.py index f48c02c..6868472 100644 --- a/functions/technologies/libs/queries.py +++ b/functions/technologies/libs/queries.py @@ -29,13 +29,10 @@ def list_data(params): filter=FieldFilter("category_obj", "array_contains_any", params_array) ) - if "client" in params: - query = query.where(filter=FieldFilter("client", "==", params["client"])) - documents = query.stream() data = [] - if "onlyname" in params and "client" not in params: + if "onlyname" in params: appended_tech = set() for doc in documents: tech = doc.get("technology") diff --git a/functions/technologies/libs/validator.py b/functions/technologies/libs/validator.py index 29d6a89..6a34617 100644 --- a/functions/technologies/libs/validator.py +++ b/functions/technologies/libs/validator.py @@ -13,7 +13,7 @@ def validate(self): # self.add_error("technology", "missing technology parameter") return Result(errors=self.errors, result=self.params) - + def add_error(self, key, error): self.errors.append([key, error])