Skip to content

Commit 3a59484

Browse files
committed
fix: fix createItem wrapper on the ItemsClient
1 parent c5a6a46 commit 3a59484

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/wrapper/ItemsClient.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class Client extends Items {
4040
collectionId: string,
4141
request: Webflow.CollectionItem,
4242
requestOptions?: Items.RequestOptions
43-
): Promise<void> {
43+
): Promise<Webflow.CollectionItem> {
4444
const _response = await core.fetcher({
4545
url: urlJoin(
4646
(await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default,
@@ -51,7 +51,8 @@ export class Client extends Items {
5151
Authorization: await this._getAuthorizationHeader(),
5252
"X-Fern-Language": "JavaScript",
5353
"X-Fern-SDK-Name": "webflow-api",
54-
"X-Fern-SDK-Version": "v2.2.1",
54+
"X-Fern-SDK-Version": "v2.3.7",
55+
"User-Agent": "webflow-api/2.3.7",
5556
"X-Fern-Runtime": core.RUNTIME.type,
5657
"X-Fern-Runtime-Version": core.RUNTIME.version,
5758
},
@@ -66,7 +67,13 @@ export class Client extends Items {
6667
maxRetries: requestOptions?.maxRetries,
6768
});
6869
if (_response.ok) {
69-
return;
70+
return serializers.CollectionItem.parseOrThrow(_response.body, {
71+
unrecognizedObjectKeys: "passthrough",
72+
allowUnrecognizedUnionMembers: true,
73+
allowUnrecognizedEnumValues: true,
74+
skipValidation: true,
75+
breadcrumbsPrefix: ["response"],
76+
});
7077
}
7178

7279
if (_response.error.reason === "status-code") {

0 commit comments

Comments
 (0)