webflow / js-webflow-api

Node.js SDK for the Webflow Data API
https://www.npmjs.com/package/webflow-api
299 stars 97 forks source link

Missing required key "id" on update collection item #160

Open Paroca72 opened 2 months ago

Paroca72 commented 2 months ago

Hello,

If I try to update a collection item using webflow.collections.items.updateItem I got an error. Error: Missing required key "id"

But both the collection id and the item id passed to the function are correct.

await webflow.collections.items.updateItem(this.collection.id, id, {
            fieldData: data,
        });

Thanks

zplata commented 2 months ago

Hey @Paroca72 - thanks for raising this! We'll take a look at fixing this; in the meantime, if you set the id again in your

{
  id: id,
  fieldData: data,
}

payload, that should in the short-term hopefully allow the request to go through.