fix: implement get_all_reviews_for_user, add crate metadata
Some checks failed
CI / Check / Test (push) Failing after 43s
Some checks failed
CI / Check / Test (push) Failing after 43s
Replace todo!() stubs in sqlite/postgres adapters with actual queries. Add description+license to presentation crate.
This commit is contained in:
@@ -578,9 +578,20 @@ impl ReviewRepository for SqliteMovieRepository {
|
||||
|
||||
async fn get_all_reviews_for_user(
|
||||
&self,
|
||||
_user_id: &UserId,
|
||||
user_id: &UserId,
|
||||
) -> Result<Vec<Review>, DomainError> {
|
||||
todo!()
|
||||
let uid = user_id.value().to_string();
|
||||
sqlx::query_as::<_, ReviewRow>(
|
||||
"SELECT id, movie_id, user_id, rating, comment, watched_at, created_at, remote_actor_url
|
||||
FROM reviews WHERE user_id = ? ORDER BY watched_at DESC",
|
||||
)
|
||||
.bind(&uid)
|
||||
.fetch_all(&self.pool)
|
||||
.await
|
||||
.map_err(Self::map_err)?
|
||||
.into_iter()
|
||||
.map(ReviewRow::into_domain)
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user