You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
storage: don't use references for pagination
This commit is contained in:
@ -60,7 +60,7 @@ pub trait UpstreamOAuthLinkRepository: Send + Sync {
|
||||
async fn list_paginated(
|
||||
&mut self,
|
||||
user: &User,
|
||||
pagination: &Pagination,
|
||||
pagination: Pagination,
|
||||
) -> Result<Page<UpstreamOAuthLink>, Self::Error>;
|
||||
}
|
||||
|
||||
@ -272,7 +272,7 @@ impl<'c> UpstreamOAuthLinkRepository for PgUpstreamOAuthLinkRepository<'c> {
|
||||
async fn list_paginated(
|
||||
&mut self,
|
||||
user: &User,
|
||||
pagination: &Pagination,
|
||||
pagination: Pagination,
|
||||
) -> Result<Page<UpstreamOAuthLink>, Self::Error> {
|
||||
let mut query = QueryBuilder::new(
|
||||
r#"
|
||||
|
@ -161,7 +161,7 @@ mod tests {
|
||||
|
||||
let links = repo
|
||||
.upstream_oauth_link()
|
||||
.list_paginated(&user, &Pagination::first(10))
|
||||
.list_paginated(&user, Pagination::first(10))
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(!links.has_previous_page);
|
||||
@ -205,7 +205,7 @@ mod tests {
|
||||
// Lookup the first 10 items
|
||||
let page = repo
|
||||
.upstream_oauth_provider()
|
||||
.list_paginated(&Pagination::first(10))
|
||||
.list_paginated(Pagination::first(10))
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
@ -217,7 +217,7 @@ mod tests {
|
||||
// Lookup the next 10 items
|
||||
let page = repo
|
||||
.upstream_oauth_provider()
|
||||
.list_paginated(&Pagination::first(10).after(ids[9]))
|
||||
.list_paginated(Pagination::first(10).after(ids[9]))
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
@ -229,7 +229,7 @@ mod tests {
|
||||
// Lookup the last 10 items
|
||||
let page = repo
|
||||
.upstream_oauth_provider()
|
||||
.list_paginated(&Pagination::last(10))
|
||||
.list_paginated(Pagination::last(10))
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
@ -241,7 +241,7 @@ mod tests {
|
||||
// Lookup the previous 10 items
|
||||
let page = repo
|
||||
.upstream_oauth_provider()
|
||||
.list_paginated(&Pagination::last(10).before(ids[10]))
|
||||
.list_paginated(Pagination::last(10).before(ids[10]))
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
@ -253,7 +253,7 @@ mod tests {
|
||||
// Lookup 10 items between two IDs
|
||||
let page = repo
|
||||
.upstream_oauth_provider()
|
||||
.list_paginated(&Pagination::first(10).after(ids[5]).before(ids[8]))
|
||||
.list_paginated(Pagination::first(10).after(ids[5]).before(ids[8]))
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
@ -52,7 +52,7 @@ pub trait UpstreamOAuthProviderRepository: Send + Sync {
|
||||
/// Get a paginated list of upstream OAuth providers
|
||||
async fn list_paginated(
|
||||
&mut self,
|
||||
pagination: &Pagination,
|
||||
pagination: Pagination,
|
||||
) -> Result<Page<UpstreamOAuthProvider>, Self::Error>;
|
||||
|
||||
/// Get all upstream OAuth providers
|
||||
@ -240,7 +240,7 @@ impl<'c> UpstreamOAuthProviderRepository for PgUpstreamOAuthProviderRepository<'
|
||||
)]
|
||||
async fn list_paginated(
|
||||
&mut self,
|
||||
pagination: &Pagination,
|
||||
pagination: Pagination,
|
||||
) -> Result<Page<UpstreamOAuthProvider>, Self::Error> {
|
||||
let mut query = QueryBuilder::new(
|
||||
r#"
|
||||
|
Reference in New Issue
Block a user