Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deleteItems and publishItems methods. Add data to the delete method callsites. #61

Merged
merged 1 commit into from
Aug 16, 2022

Conversation

wf-d-whitely
Copy link
Contributor

Adding new methods and passing data into the delete method.

const Webflow = require('webflow-api');

const api = new Webflow({
  token: "<access_token>",
});

Promise.all([
  api.publishItems({
    collectionId: "<collection_id>",
    itemIds: [
      "<item_id_1>",
      "<item_id_2>",
      "<item_id_x>",
    ],
  }),
  api.deleteItems(
    {
      collectionId: "<collection_id>",
      itemIds: [
        "<item_id_1>",
        "<item_id_2>",
        "<item_id_x>",
      ],
    },
    { live: true }
  ),
]).then((x) => console.log(x));

returns

[
  {
    publishedItemIds: [
      "<item_id_1>",
      "<item_id_2>",
      "<item_id_x>",
    ],
    errors: [],
    _meta: { rateLimit: { limit: 60, remaining: 57 } }
  },
  {
    unpublishedItemIds: [
      "<item_id_1>",
      "<item_id_2>",
      "<item_id_x>",
    ],
    errors: [],
    _meta: { rateLimit: { limit: 60, remaining: 56 } }
  }
]

@wf-d-whitely wf-d-whitely marked this pull request as ready for review August 15, 2022 17:33
@johnagan johnagan merged commit a866abd into webflow:master Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants