(
&self,
page: Option<u64>,
posts_per_page: Option<u64>,
)
| 44 | #[async_trait] |
| 45 | impl PostRpcServer for PpcImpl { |
| 46 | async fn list( |
| 47 | &self, |
| 48 | page: Option<u64>, |
| 49 | posts_per_page: Option<u64>, |
| 50 | ) -> RpcResult<Vec<post::Model>> { |
| 51 | let page = page.unwrap_or(1); |
| 52 | let posts_per_page = posts_per_page.unwrap_or(DEFAULT_POSTS_PER_PAGE); |
| 53 | |
| 54 | Query::find_posts_in_page(&self.conn, page, posts_per_page) |
| 55 | .await |
| 56 | .map(|(p, _)| p) |
| 57 | .internal_call_error() |
| 58 | } |
| 59 | |
| 60 | async fn insert(&self, p: post::Model) -> RpcResult<i32> { |
| 61 | let new_post = Mutation::create_post(&self.conn, p) |
nothing calls this directly
no test coverage detected