Skip to content

Commit 0001f08

Browse files
Merge pull request #25 from xabk/main
Fix Assign/unassign label from strings paths
2 parents b271811 + 36a605d commit 0001f08

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crowdin_api/api_resources/labels/resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def assign_label_to_strings(self, projectId: int, labelId: int, stringIds: Itera
103103
return self.requester.request(
104104
method="post",
105105
request_data={"stringIds": stringIds},
106-
path=self.get_labels_path(projectId=projectId, labelId=labelId),
106+
path=f"{self.get_labels_path(projectId=projectId, labelId=labelId)}/strings",
107107
)
108108

109109
def unassign_label_from_strings(self, projectId: int, labelId: int, stringIds: Iterable[int]):
@@ -117,5 +117,5 @@ def unassign_label_from_strings(self, projectId: int, labelId: int, stringIds: I
117117
return self.requester.request(
118118
method="delete",
119119
params={"stringIds": ",".join(str(stringId) for stringId in stringIds)},
120-
path=self.get_labels_path(projectId=projectId, labelId=labelId),
120+
path=f"{self.get_labels_path(projectId=projectId, labelId=labelId)}/strings",
121121
)

crowdin_api/api_resources/labels/tests/test_labels_resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_assign_label_to_strings(self, m_request, base_absolut_url):
9999
m_request.assert_called_once_with(
100100
request_data={"stringIds": [1, 2]},
101101
method="post",
102-
path=resource.get_labels_path(projectId=1, labelId=2),
102+
path=f"{resource.get_labels_path(projectId=1, labelId=2)}/strings",
103103
)
104104

105105
@mock.patch("crowdin_api.requester.APIRequester.request")
@@ -114,5 +114,5 @@ def test_unassign_label_from_strings(self, m_request, base_absolut_url):
114114
m_request.assert_called_once_with(
115115
params={"stringIds": "1,2"},
116116
method="delete",
117-
path=resource.get_labels_path(projectId=1, labelId=2),
117+
path=f"{resource.get_labels_path(projectId=1, labelId=2)}/strings",
118118
)

0 commit comments

Comments
 (0)