mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-07-15 19:58:05 +00:00
Can search users
This commit is contained in:
src
controllers
data
helpers
@ -340,6 +340,15 @@ impl HttpRequestHandler {
|
||||
Ok(self.post_string(name)?.parse::<i64>()?)
|
||||
}
|
||||
|
||||
/// Get an optional number in the request. If none found, return a default value
|
||||
pub fn post_u64_opt(&mut self, name: &str, default: u64) -> ResultBoxError<u64> {
|
||||
if self.has_post_parameter(name) {
|
||||
Ok(self.post_string(name)?.parse::<u64>()?)
|
||||
} else {
|
||||
Ok(default)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn post_u64(&mut self, name: &str) -> ResultBoxError<u64> {
|
||||
Ok(self.post_string(name)?.parse::<u64>()?)
|
||||
}
|
||||
|
Reference in New Issue
Block a user