This commit is contained in:
@@ -1549,17 +1549,10 @@ async fn upload_attachments(
|
||||
) -> Result<JsonResp<Value>, AppError> {
|
||||
let role = match q.role.as_deref().map(str::trim).filter(|s| !s.is_empty()) {
|
||||
None => None,
|
||||
Some(r)
|
||||
if matches!(
|
||||
r,
|
||||
"chord" | "chord_letters" | "chord_functional" | "numbered" | "staff"
|
||||
) =>
|
||||
{
|
||||
Some(r.to_string())
|
||||
}
|
||||
Some(r) if matches!(r, "chord" | "jianpu" | "numbered" | "staff") => Some(r.to_string()),
|
||||
Some(other) => {
|
||||
return Err(AppError::bad_request(format!(
|
||||
"unsupported role '{other}', expect one of: chord / chord_letters / chord_functional / numbered / staff"
|
||||
"unsupported role '{other}', expect one of: chord / jianpu / numbered / staff"
|
||||
)));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user