Hi Ben, I recently ran into the same need. I’ve solved it for now with a bit of Strapi customization, but I’m not sure how well it will scale in the long run. Disclaimer aside, what I did was create a table (we’re using postgresql) for “revisions” that stores some timestamps along with a json representation and lastly the corresponding model name. Then I customized the content-manger plugin to create a snapshot of the content on create, update, publish, unpublish (kind of like an audit table). With that, I tweaked the admin ui such that any time a user edits and saves content while it’s in the published state, it then goes to a new “revised” state. While in revised state, the api serves the most recent revision if the _publicationState=preview (or not specified), but if the _publicationState=live, it serves the last published version. I don’t know if that makes sense, but this is the general approach I took, and it seems to be working for the time being. I’d love to see this as a fully supported feature someday. Hope that’s somewhat helpful!
1 Like