Add some HTTP tests for recipe fields and recipe tags

This commit is contained in:
Greg Burri 2025-05-15 00:36:07 +02:00
parent 9c2d89e981
commit e4ec80e118
6 changed files with 179 additions and 11 deletions

View file

@ -231,7 +231,7 @@ pub fn setup_page(recipe_id: i64) {
{
let is_public: HtmlInputElement = by_id("input-is-public");
EventListener::new(&is_public.clone(), "input", move |_event| {
let body = ron_api::SetIsPublic {
let body = ron_api::SetRecipeIsPublic {
recipe_id,
is_public: is_public.checked(),
};

View file

@ -59,10 +59,7 @@ where
{
let mut url = format!("/ron-api/{}?", api_name);
serde_html_form::ser::push_to_string(&mut url, params).unwrap();
let request_builder = method_fn(&url).header(
CONTENT_TYPE,
common::consts::MIME_TYPE_RON.to_str().unwrap(),
);
let request_builder = method_fn(&url);
send_req(request_builder.build()?).await
}