mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-24 19:59:50 -04:00
Fix issues with category text usage
This commit is contained in:
parent
3fde0401b2
commit
b957ed7f3a
@ -14,8 +14,7 @@
|
|||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
use reqwasm;
|
use reqwasm;
|
||||||
//use serde::{Deserialize, Serialize};
|
use serde_json::{from_str, to_string};
|
||||||
use serde_json::to_string;
|
|
||||||
use sycamore::prelude::*;
|
use sycamore::prelude::*;
|
||||||
use tracing::{debug, error, info, instrument, warn};
|
use tracing::{debug, error, info, instrument, warn};
|
||||||
|
|
||||||
@ -149,7 +148,7 @@ impl HttpStore {
|
|||||||
Err(format!("Status: {}", resp.status()).into())
|
Err(format!("Status: {}", resp.status()).into())
|
||||||
} else {
|
} else {
|
||||||
debug!("We got a valid response back!");
|
debug!("We got a valid response back!");
|
||||||
let resp = resp.text().await;
|
let resp = resp.json().await;
|
||||||
Ok(Some(resp.map_err(|e| format!("{}", e))?))
|
Ok(Some(resp.map_err(|e| format!("{}", e))?))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,10 +95,10 @@ pub fn Categories<G: Html>(cx: Scope) -> View<G> {
|
|||||||
view! {cx,
|
view! {cx,
|
||||||
(dialog_view)
|
(dialog_view)
|
||||||
textarea(bind:value=category_text, rows=20)
|
textarea(bind:value=category_text, rows=20)
|
||||||
a(role="button", href="#", on:click=move |_| {
|
span(role="button", on:click=move |_| {
|
||||||
check_category_text_parses(category_text.get().as_str(), error_text);
|
check_category_text_parses(category_text.get().as_str(), error_text);
|
||||||
}) { "Check" } " "
|
}) { "Check" } " "
|
||||||
a(role="button", href="#", on:click=move |_| {
|
span(role="button", on:click=move |_| {
|
||||||
// TODO(jwall): check and then save the categories.
|
// TODO(jwall): check and then save the categories.
|
||||||
if check_category_text_parses(category_text.get().as_str(), error_text) {
|
if check_category_text_parses(category_text.get().as_str(), error_text) {
|
||||||
debug!("triggering category save");
|
debug!("triggering category save");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user