From 2a533865f09cdf473f6e215265adb8aec97dc146 Mon Sep 17 00:00:00 2001 From: Eason <30045503+Eason0729@users.noreply.github.com> Date: Tue, 13 Aug 2024 14:08:48 +0000 Subject: [PATCH] fix raw text paginator bug(not using offset and size) --- backend/src/entity/util/paginator.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/entity/util/paginator.rs b/backend/src/entity/util/paginator.rs index a7d98a1..ff47389 100644 --- a/backend/src/entity/util/paginator.rs +++ b/backend/src/entity/util/paginator.rs @@ -172,8 +172,8 @@ impl> PaginateRaw for PrimaryKeyPaginator async fn new_fetch( data: S::Data, auth: &Auth, - _size: u64, - _offset: u64, + size: u64, + offset: u64, abs_dir: bool, db: &DatabaseConnection, ) -> Result<(Self, Vec), Error> { @@ -181,7 +181,9 @@ impl> PaginateRaw for PrimaryKeyPaginator S::filter(auth, &data, db).await?, ::ID, abs_dir, - ); + ) + .limit(size) + .offset(offset); let models = R::all(query, db).await?;