news-catalyst / google-app-scripts

a collection of scripts for tinynews google docs add-ons
https://script.google.com/a/newscatalyst.org/d/1ILURq69o3cYUy6k1n1X6HwxdMfl9xWNhILYuZxgLfeblb3IR15WCMZSj/edit
1 stars 1 forks source link

Added missing feature to unpublish a page #368

Closed jacqui closed 2 years ago

jacqui commented 2 years ago

Closes #367

Test using version 106 in the script editor.

The problem was that I never 🤦‍♀️ coded the unpublish-page feature - it just worked for articles. So if the doc wasn't for an article, the code for "unpublish" was falling through to the "else" scenario, and showing a generic error.

This PR adds an unpublish page mutation + function and the extra use case to the html for the sidebar.

I tested by opening Oaklyn's "Donate" page, unpublishing it, trying to load it on the site, getting a 404, re-publishing it, and reloading the page successfully.