Forbid 0 in maxTotalHits

This commit is contained in:
Tamo 2025-05-15 11:32:08 +02:00
parent d40290aaaf
commit 1d6777ee68
4 changed files with 56 additions and 6 deletions

View file

@ -454,7 +454,9 @@ pub struct PaginationAnalytics {
impl PaginationAnalytics {
pub fn new(setting: Option<&PaginationSettings>) -> Self {
Self { max_total_hits: setting.as_ref().and_then(|s| s.max_total_hits.set()) }
Self {
max_total_hits: setting.as_ref().and_then(|s| s.max_total_hits.set().map(|x| x.into())),
}
}
pub fn into_settings(self) -> SettingsAnalytics {