pub async fn create_snapshot( state: AppState, ref_id: Uuid, ) -> Result<(), AppError>
Saves the document by creating a new snapshot and setting the current_snapshot to it.