(state: &DashboardState, limit: i64)
| 675 | } |
| 676 | |
| 677 | pub(crate) async fn curation_activity_payload(state: &DashboardState, limit: i64) -> Value { |
| 678 | let events = state.curation_activity.read().await; |
| 679 | let limit = limit.max(0) as usize; |
| 680 | let start = events.len().saturating_sub(limit); |
| 681 | let visible: Vec<Value> = events[start..].to_vec(); |
| 682 | let count = visible.len(); |
| 683 | json!({ "events": visible, "count": count, "limit": limit, "error": "" }) |
| 684 | } |
| 685 | |
| 686 | pub(crate) async fn curation_preview_payload(state: &DashboardState) -> Value { |
| 687 | let preview = state.curate_preview.read().await; |
no test coverage detected