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:
15
src/helpers/groups_helper.rs
Normal file
15
src/helpers/groups_helper.rs
Normal 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"))
|
||||
}
|
@@ -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;
|
Reference in New Issue
Block a user