Skip to content

Commit

Permalink
fix: fix createItem wrapper on the ItemsClient
Browse files Browse the repository at this point in the history
  • Loading branch information
zplata committed Sep 12, 2024
1 parent 2934568 commit ced7fbb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/wrapper/ItemsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class Client extends Items {
collectionId: string,
request: Webflow.CollectionItem,
requestOptions?: Items.RequestOptions
): Promise<void> {
): Promise<Webflow.CollectionItem> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default,
Expand All @@ -51,7 +51,8 @@ export class Client extends Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "v2.2.1",
"X-Fern-SDK-Version": "v2.3.7",
"User-Agent": "webflow-api/2.3.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand All @@ -66,7 +67,13 @@ export class Client extends Items {
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return;
return serializers.CollectionItem.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
skipValidation: true,
breadcrumbsPrefix: ["response"],
});
}

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

0 comments on commit ced7fbb

Please sign in to comment.