fix(admin): remove redundant encrypt
This commit is contained in:
@@ -222,28 +222,12 @@ pub async fn update_rule(
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encrypt custom_response if provided
|
|
||||||
let custom_response = if let Some(resp) = req.custom_response {
|
|
||||||
match crypto::encrypt(&resp, &state.key, &state.iv) {
|
|
||||||
Ok(encrypted) => Some(encrypted),
|
|
||||||
Err(e) => {
|
|
||||||
error!("Failed to encrypt custom response: {}", e);
|
|
||||||
return Err((
|
|
||||||
StatusCode::BAD_REQUEST,
|
|
||||||
Json(ApiError::new("Failed to encrypt custom response")),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
match db::repositories::rules::update(
|
match db::repositories::rules::update(
|
||||||
&state.db,
|
&state.db,
|
||||||
id,
|
id,
|
||||||
req.method_name.as_deref(),
|
req.method_name.as_deref(),
|
||||||
req.action.as_deref(),
|
req.action.as_deref(),
|
||||||
custom_response.as_deref(),
|
req.custom_response.as_deref(),
|
||||||
req.is_enabled,
|
req.is_enabled,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user