Lost refactor.
This commit is contained in:
@@ -19,9 +19,7 @@ pub async fn list<'e, E>(executor: E, query: Query) -> Result<Vec<Transaction>,
|
||||
where
|
||||
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
|
||||
{
|
||||
let transactions = db::list(
|
||||
executor,
|
||||
db::Query {
|
||||
let query = db::Query {
|
||||
limit: query
|
||||
.limit
|
||||
.map(|l| i64::try_from(l).map_err(|_| QueryConversionError::Limit(l)))
|
||||
@@ -30,8 +28,9 @@ where
|
||||
.offset
|
||||
.map(|o| i64::try_from(o).map_err(|_| QueryConversionError::Offset(o)))
|
||||
.transpose()?,
|
||||
},
|
||||
)
|
||||
};
|
||||
|
||||
let transactions = db::list(executor, query)
|
||||
.await?
|
||||
.into_iter()
|
||||
.map(decode)
|
||||
|
||||
Reference in New Issue
Block a user