Skip to content

Commit 889cef4

Browse files
committed
Fix request format in collection creation/update
1 parent 78b6783 commit 889cef4

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

intercom_python_sdk/apis/help_center/api.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
# External
1818
from uplink import (
19+
json,
1920
get, put,
2021
post, delete,
2122
Query, Body,
@@ -83,18 +84,7 @@ def list_all_collections(self):
8384
return resp
8485

8586
@returns(CollectionSchema(many=False)) # type: ignore
86-
@post("collections")
87-
def create_collection(self, data: Body(CollectionSchema)): # type: ignore
88-
""" Create a Collection.
89-
90-
Args:
91-
data (dict): The data to create the Collection with.
92-
93-
Returns:
94-
Collection: The created Collection.
95-
"""
96-
97-
@returns(CollectionSchema(many=False)) # type: ignore
87+
@json()
9888
@put("collections/{collection_id}")
9989
def update_collection_by_id(self, collection_id: Union[str, int], data: Body(type=CollectionSchema)): # type: ignore
10090
""" Update a Collection.
@@ -108,6 +98,7 @@ def update_collection_by_id(self, collection_id: Union[str, int], data: Body(typ
10898
"""
10999

110100
@returns(CollectionSchema(many=False)) # type: ignore
101+
@json()
111102
@post("collections")
112103
def create_collection(self, data: Body(type=CollectionSchema)): # type: ignore
113104
""" Create a Collection.

intercom_python_sdk/core/errors.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,6 @@ def catch_api_error(response): # type: ignore
9898
data = response.json()
9999
error = IntercomErrorListSchema().load(data)
100100

101+
print(response.content)
102+
101103
raise error # type: ignore

0 commit comments

Comments
 (0)