news-catalyst / next-tinynewsdemo

Frontend for Tiny News Collective organizations
https://next-tinynewsdemo.vercel.app
1 stars 0 forks source link

Unpublishing a featured article should fail #1258

Open TylerFisher opened 2 years ago

TylerFisher commented 2 years ago

Currently, if a user uses the sidebar to unpublish an article, and that article is featured on the homepage, the homepage breaks because it's trying to access an article that doesn't exist anymore. We should not allow unpublishing of featured articles at all.

When the unpublish API code runs, we should check for the currently featured articles and ensure we're not unpublishing a featured article before moving forward.

chelsea-tnc commented 2 years ago

Repro steps: 1) Go to https://[your org]/tinycms 2) In the Google Doc sidebar, unpublish the article 3) Observe the homepage

Expected Result: The article should be unpublished, but the homepage should render
Actual Result: The entire homepage shows a 404 error

Workaround for this issue can be found here. This doesn't happen often, usually during onboarding for new orgs when they're trying out article publishing.