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

Publishing a new document with a used slug overwrites the existing article #338

Closed TylerFisher closed 3 years ago

TylerFisher commented 3 years ago

In migrating Crystal's content, she had two articles that ended up returning the same slug. One was headlined "The 2021 West Virginia Black Legislative Agenda?", the next piece did not have a question mark.

The right behavior would be one of two things:

  1. Append a number to the slug the-2021-west-virginia-black-legislative-agenda-2
  2. Return an error and ask the user to adjust the slug.
jacqui commented 3 years ago

Returning an error seems like the most straightforward approach here.

So, this will require: