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

Delete: Allow passing live parameter #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vfonic
Copy link
Contributor

@vfonic vfonic commented May 23, 2023

I've been constantly having issues with Webflow CMS items not being properly synced.
I realized that removing the items is the most problematic.

I ended up publishing for every "delete".
I finally found a "cheaper" way to achieve this.
If we delete without live: true, the item will stay visible on the site until the site is published again.
If we delete with live: true, the item will be set as draft and not visible on the site, but it will be visible in the Webflow CMS.
We can call delete with live: true to remove it from the site (and make it a draft) and then call delete again, without live: true to remove the item from Webflow completely:

client.delete_item({ '_cid' => collection['_id'], '_id' => webflow_item_id }, live: true)
client.delete_item({ '_cid' => collection['_id'], '_id' => webflow_item_id })

To allow this functionality, I need the support for live: keyword argument to delete_item method.

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.

1 participant