remove operator as target for scheduled prompts
This commit is contained in:
parent
f263f82047
commit
b4dc09ff93
7 changed files with 130 additions and 86 deletions
|
|
@ -98,6 +98,14 @@ pub(super) async fn post_schedule_new(
|
|||
return Err(ProblemDetails::from_status_code(StatusCode::BAD_REQUEST)
|
||||
.with_detail("schedule must have at least one target"));
|
||||
}
|
||||
if payload
|
||||
.targets
|
||||
.iter()
|
||||
.any(|t| t == hive_sh4re::manager::OPERATOR_RECIPIENT)
|
||||
{
|
||||
return Err(ProblemDetails::from_status_code(StatusCode::BAD_REQUEST)
|
||||
.with_detail("operator is not a valid schedule target"));
|
||||
}
|
||||
if payload.body.trim().is_empty() {
|
||||
return Err(ProblemDetails::from_status_code(StatusCode::BAD_REQUEST)
|
||||
.with_detail("schedule body must be non-empty"));
|
||||
|
|
|
|||
Loading…
Reference in a new issue