Add some HTTP tests for recipe fields and recipe tags
This commit is contained in:
parent
9c2d89e981
commit
e4ec80e118
6 changed files with 179 additions and 11 deletions
|
|
@ -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(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue