diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 60 |
1 files changed, 58 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs index 36210e7..a884201 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,7 +31,10 @@ use reactive_stores::Store; use rocie_client::apis::configuration::Configuration; use crate::pages::{ - associate_barcode::AssociateBarcode, buy::Buy, create_product::CreateProduct, home::Home, inventory::Inventory, not_found::NotFound, recipies::Recipies + associate_barcode::AssociateBarcode, buy::Buy, create_product::CreateProduct, + create_product_parent::CreateProductParent, create_recipe::CreateRecipe, home::Home, + inventory::Inventory, login::Login, not_found::NotFound, product::Product, products::Products, + provision::Provision, recipe::Recipe, recipies::Recipies, units::Units, }; #[derive(Debug, Clone, Store)] @@ -40,6 +43,7 @@ pub struct ConfigState { } #[component] +#[expect(clippy::too_many_lines)] pub fn App() -> impl IntoView { // Provides context that manages stylesheets, titles, meta tags, etc. provide_meta_context(); @@ -48,7 +52,7 @@ pub fn App() -> impl IntoView { let mut config = Configuration::new(); config.user_agent = Some("rocie-mobile".to_owned()); - "http://127.0.0.1:8080".clone_into(&mut config.base_path); + "/api/".clone_into(&mut config.base_path); config }; @@ -71,6 +75,18 @@ pub fn App() -> impl IntoView { view! { <Home /> } } /> + <Route + path=path!("/login") + view=move || { + view! { <Login /> } + } + /> + <Route + path=path!("/provision") + view=move || { + view! { <Provision /> } + } + /> // Inventory <Route @@ -93,9 +109,27 @@ pub fn App() -> impl IntoView { view! { <Recipies /> } } /> + <Route + path=path!("/recipe/:name") + view=move || { + view! { <Recipe /> } + } + /> + <Route + path=path!("/create-recipe") + view=move || { + view! { <CreateRecipe /> } + } + /> // Products <Route + path=path!("/products") + view=move || { + view! { <Products /> } + } + /> + <Route path=path!("/create-product") view=move || { view! { <CreateProduct /> } @@ -107,6 +141,28 @@ pub fn App() -> impl IntoView { view! { <AssociateBarcode /> } } /> + <Route + path=path!("/product/:name") + view=move || { + view! { <Product /> } + } + /> + + // Product Parents + <Route + path=path!("/create-product-parent") + view=move || { + view! { <CreateProductParent /> } + } + /> + + // Units + <Route + path=path!("/units") + view=move || { + view! { <Units /> } + } + /> </Routes> </Router> } |
