fix: don't allow communities to be renamed to in-use names

This commit is contained in:
trisua 2025-04-12 10:15:47 -04:00
parent 5995aaf31c
commit e092d46586
7 changed files with 50 additions and 11 deletions

View file

@ -31,6 +31,7 @@ pub enum Error {
DataTooLong(String),
DataTooShort(String),
UsernameInUse,
TitleInUse,
Unknown,
}
@ -49,6 +50,7 @@ impl ToString for Error {
Self::DataTooLong(name) => format!("Given {name} is too long!"),
Self::DataTooShort(name) => format!("Given {name} is too short!"),
Self::UsernameInUse => "Username in use".to_string(),
Self::TitleInUse => "Title in use".to_string(),
_ => format!("An unknown error as occurred: ({:?})", self),
}
}