apps: get all: remove ezidam inside

This commit is contained in:
Philippe Loctaux 2023-05-08 20:00:49 +02:00
parent a05646a19b
commit 27a6ae9a14
2 changed files with 8 additions and 6 deletions

View file

@ -26,11 +26,16 @@ impl App {
conn: impl SqliteExecutor<'_>, conn: impl SqliteExecutor<'_>,
filter_get_archived: Option<bool>, filter_get_archived: Option<bool>,
) -> Result<Vec<Self>, Error> { ) -> Result<Vec<Self>, Error> {
Ok(DatabaseApps::get_all(conn, filter_get_archived) let mut apps = DatabaseApps::get_all(conn, filter_get_archived)
.await? .await?
.into_iter() .into_iter()
.map(Self::from) .map(Self::from)
.collect::<Vec<_>>()) .collect::<Vec<_>>();
// Remove ezidam from list
apps.retain(|app| *app.id() != AppID("ezidam".into()));
Ok(apps)
} }
pub async fn insert( pub async fn insert(

View file

@ -10,10 +10,7 @@ pub async fn admin_apps_list(
admin: JwtAdmin, admin: JwtAdmin,
flash: Option<FlashMessage<'_>>, flash: Option<FlashMessage<'_>>,
) -> Result<Template> { ) -> Result<Template> {
let mut apps = App::get_all(&mut *db, None).await?; let apps = App::get_all(&mut *db, None).await?;
// Remove ezidam from list
apps.retain(|app| *app.id() != AppID("ezidam".into()));
let page = Page::AdminAppsList(super::content::AdminAppsList { let page = Page::AdminAppsList(super::content::AdminAppsList {
user: admin.0, user: admin.0,