Forbid empty titles in application layer
This commit is contained in:
parent
dd97b8055c
commit
3dd4927281
1 changed files with 8 additions and 0 deletions
|
@ -204,6 +204,10 @@ impl State {
|
|||
let connection_pool = self.connection_pool.clone();
|
||||
|
||||
self.cpu_pool.spawn_fn(move || {
|
||||
if title.is_empty() {
|
||||
Err("title cannot be empty")?;
|
||||
}
|
||||
|
||||
let conn = connection_pool.get()?;
|
||||
|
||||
conn.transaction(|| {
|
||||
|
@ -263,6 +267,10 @@ impl State {
|
|||
let connection_pool = self.connection_pool.clone();
|
||||
|
||||
self.cpu_pool.spawn_fn(move || {
|
||||
if title.is_empty() {
|
||||
Err("title cannot be empty")?;
|
||||
}
|
||||
|
||||
let conn = connection_pool.get()?;
|
||||
|
||||
conn.transaction(|| {
|
||||
|
|
Loading…
Reference in a new issue