feat: implement media listing with sorting and filtering options
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use libertas_core::{
|
||||
config::{DatabaseConfig, DatabaseType},
|
||||
config::{Config, DatabaseConfig, DatabaseType},
|
||||
error::{CoreError, CoreResult},
|
||||
repositories::UserRepository,
|
||||
};
|
||||
@@ -47,12 +47,12 @@ pub async fn build_user_repository(
|
||||
}
|
||||
|
||||
pub async fn build_media_repository(
|
||||
_db_config: &DatabaseConfig,
|
||||
config: &Config,
|
||||
pool: DatabasePool,
|
||||
) -> CoreResult<Arc<dyn libertas_core::repositories::MediaRepository>> {
|
||||
match pool {
|
||||
DatabasePool::Postgres(pg_pool) => Ok(Arc::new(
|
||||
crate::repositories::media_repository::PostgresMediaRepository::new(pg_pool),
|
||||
crate::repositories::media_repository::PostgresMediaRepository::new(pg_pool, config),
|
||||
)),
|
||||
DatabasePool::Sqlite(_sqlite_pool) => Err(CoreError::Database(
|
||||
"Sqlite media repository not implemented".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user