mirror of
https://github.com/bybrooklyn/alchemist.git
synced 2026-04-18 01:43:34 -04:00
fix compiler error
This commit is contained in:
@@ -347,10 +347,7 @@ fn app_router(state: Arc<AppState>) -> Router {
|
||||
"/api/settings/watch-dirs",
|
||||
get(get_watch_dirs_handler).post(add_watch_dir_handler),
|
||||
)
|
||||
.route(
|
||||
"/api/settings/folders",
|
||||
post(sync_watch_dirs_handler),
|
||||
)
|
||||
.route("/api/settings/folders", post(sync_watch_dirs_handler))
|
||||
.route(
|
||||
"/api/settings/watch-dirs/:id",
|
||||
delete(remove_watch_dir_handler),
|
||||
|
||||
@@ -433,7 +433,13 @@ pub(crate) async fn add_notification_handler(
|
||||
State(state): State<Arc<AppState>>,
|
||||
axum::Json(payload): axum::Json<AddNotificationTargetPayload>,
|
||||
) -> impl IntoResponse {
|
||||
if let Err(msg) = validate_notification_url(&payload.endpoint_url).await {
|
||||
let allow_local = state
|
||||
.config
|
||||
.read()
|
||||
.await
|
||||
.notifications
|
||||
.allow_local_notifications;
|
||||
if let Err(msg) = validate_notification_url(&payload.endpoint_url, allow_local).await {
|
||||
return (StatusCode::BAD_REQUEST, msg).into_response();
|
||||
}
|
||||
|
||||
@@ -507,7 +513,13 @@ pub(crate) async fn test_notification_handler(
|
||||
State(state): State<Arc<AppState>>,
|
||||
axum::Json(payload): axum::Json<AddNotificationTargetPayload>,
|
||||
) -> impl IntoResponse {
|
||||
if let Err(msg) = validate_notification_url(&payload.endpoint_url).await {
|
||||
let allow_local = state
|
||||
.config
|
||||
.read()
|
||||
.await
|
||||
.notifications
|
||||
.allow_local_notifications;
|
||||
if let Err(msg) = validate_notification_url(&payload.endpoint_url, allow_local).await {
|
||||
return (StatusCode::BAD_REQUEST, msg).into_response();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user