fix: trim forum post titles
This commit is contained in:
parent
80a39e7489
commit
9650c0177e
10 changed files with 22 additions and 17 deletions
|
@ -54,7 +54,7 @@ impl DataManager {
|
|||
/// * `data` - a mock [`Service`] object to insert
|
||||
pub async fn create_service(&self, data: Service) -> Result<Service> {
|
||||
// check values
|
||||
if data.name.len() < 2 {
|
||||
if data.name.trim().len() < 2 {
|
||||
return Err(Error::DataTooShort("name".to_string()));
|
||||
} else if data.name.len() > 128 {
|
||||
return Err(Error::DataTooLong("name".to_string()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue