Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing groupId inside list glossaries/projects #77

Merged
merged 3 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion crowdin_api/api_resources/glossaries/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def get_glossaries_path(self, glossaryId: Optional[int] = None):

def list_glossaries(
self,
groupId: Optional[int] = None,
page: Optional[int] = None,
offset: Optional[int] = None,
limit: Optional[int] = None,
Expand All @@ -49,10 +50,13 @@ def list_glossaries(
https://developer.crowdin.com/api/v2/#operation/api.glossaries.getMany
"""

params = {"groupId": groupId}
params.update(self.get_page_params(page=page, offset=offset, limit=limit))

return self._get_entire_data(
method="get",
path=self.get_glossaries_path(),
params=self.get_page_params(page=page, offset=offset, limit=limit),
params=params,
)

def add_glossary(self, name: str, languageId: str):
Expand Down
3 changes: 2 additions & 1 deletion crowdin_api/api_resources/projects/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def list_projects(
page: Optional[int] = None,
offset: Optional[int] = None,
limit: Optional[int] = None,
groupId: Optional[int] = None,
userId: Optional[Union[int, str]] = None,
hasManagerAccess: Optional[HasManagerAccess] = None,
):
Expand All @@ -56,7 +57,7 @@ def list_projects(
https://developer.crowdin.com/api/v2/#operation/api.projects.getMany
"""

params = {"userId": userId, "hasManagerAccess": hasManagerAccess}
params = {"userId": userId, "hasManagerAccess": hasManagerAccess, "groupId": groupId}
params.update(self.get_page_params(page=page, offset=offset, limit=limit))

return self._get_entire_data(method="get", path=self.get_projects_path(), params=params)
Expand Down