Skip to content

Commit 1c9f7a0

Browse files
committed
format library.rs
1 parent 802d73a commit 1c9f7a0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

graphql/src/schema/library.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,14 @@ impl LibraryQuery {
103103
.collect());
104104
}
105105

106-
let db = ctx.data::<Database>().unwrap();
107-
let results = ArtistRepository::new(db.get_connection());
106+
let db = ctx.data::<Database>().unwrap();
107+
108+
let results = ArtistRepository::new(db.get_connection())
109+
.find_all(filter, offset.map(|x| x as u64), limit.map(|x| x as u64))
110+
.await?;
111+
112+
Ok(results.into_iter().map(Into::into).collect())
113+
}
108114

109115
async fn albums(
110116
&self,
@@ -143,6 +149,7 @@ impl LibraryQuery {
143149
}
144150

145151
let db = ctx.data::<Database>().unwrap();
152+
146153
let results = AlbumRepository::new(db.get_connection())
147154
.find_all(filter, offset.map(|x| x as u64), limit.map(|x| x as u64))
148155
.await?;

0 commit comments

Comments
 (0)