mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-22 13:29:21 +00:00
Add more flexibility to conservation policy update
This commit is contained in:
parent
2e912b7e1c
commit
d2d16d42d3
@ -357,7 +357,7 @@ pub trait BaseRequestHandler {
|
||||
}
|
||||
|
||||
fn post_positive_u64_opt(&mut self, name: &str) -> Res<Option<u64>> {
|
||||
match self.post_u64(name)? {
|
||||
match self.post_u64_opt(name, 0)? {
|
||||
0 => Ok(None),
|
||||
val => Ok(Some(val))
|
||||
}
|
||||
|
@ -944,6 +944,13 @@ pub fn update(u: UpdateInfo) -> ResultBoxError<()> {
|
||||
|
||||
query_sql = format!("{} {} WHERE {}", query_sql, updates, conditions);
|
||||
|
||||
if conf().database.log_all_queries {
|
||||
watcher::ExecDatabaseQuery::new(
|
||||
&query_sql,
|
||||
&values.iter().map(|f| mysql::Value::from(f)).collect(),
|
||||
).display();
|
||||
}
|
||||
|
||||
get_connection()?.exec_drop(
|
||||
query_sql,
|
||||
values,
|
||||
|
Loading…
Reference in New Issue
Block a user