1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-09-19 11:28:46 +00:00

Can search for virtual directory

This commit is contained in:
2020-06-03 13:28:28 +02:00
parent d30b1ea776
commit 8745f8363c
6 changed files with 67 additions and 4 deletions

View File

@@ -0,0 +1,15 @@
//! # Groups helper
//!
//! @author Pierre Hubert
use crate::data::error::ResultBoxError;
use crate::helpers::database;
use crate::constants::database_tables_names::GROUPS_LIST_TABLE;
/// Find a group id by virtual directory
pub fn find_by_virtual_directory(dir: &str) -> ResultBoxError<u64> {
database::QueryInfo::new(GROUPS_LIST_TABLE)
.cond("virtual_directory", dir)
.add_field("id")
.query_row(|res| res.get_u64("id"))
}

View File

@@ -6,4 +6,5 @@ pub mod user_helper;
pub mod friends_helper;
pub mod custom_emojies_helper;
pub mod background_image_helper;
pub mod likes_helper;
pub mod likes_helper;
pub mod groups_helper;