mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-02-07 09:47:04 +00:00
15 lines
454 B
Rust
15 lines
454 B
Rust
|
//! # 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"))
|
||
|
}
|