From 9135e524f358d17eb9e4fbbb68dc78342c9e1d39 Mon Sep 17 00:00:00 2001 From: Marko Radisic Date: Fri, 2 Feb 2024 12:13:35 +0100 Subject: [PATCH] fix: Fixed incorrect filtering of subscribers --- mailerlite/sdk/subscribers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mailerlite/sdk/subscribers.py b/mailerlite/sdk/subscribers.py index 079c18e..361fc3e 100644 --- a/mailerlite/sdk/subscribers.py +++ b/mailerlite/sdk/subscribers.py @@ -30,7 +30,11 @@ def list(self, **kwargs): for key, val in params["kwargs"].items(): if key not in available_params: raise TypeError("Got an unknown argument '%s'" % key) - query_params[key] = val + if key == "filter": + for filter_key, filter_value in val.items(): + query_params[f"filter[{filter_key}]"] = filter_value + else: + query_params[key] = val return self.api_client.request("GET", self.base_api_url, query_params).json()