about summary refs log tree commit diff stats
path: root/crates/rocie-cli/src/handle/mod.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-12-09 13:30:25 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-12-09 13:30:25 +0100
commitf7869a09906747d0797dcd8c49c069fa8f02930c (patch)
treef219226e62d16995cd4906d57f7e279b591460ff /crates/rocie-cli/src/handle/mod.rs
parentstyle(treewide): Format (diff)
downloadserver-f7869a09906747d0797dcd8c49c069fa8f02930c.zip
chore(treewide): Remove last references to old paths
Diffstat (limited to 'crates/rocie-cli/src/handle/mod.rs')
-rw-r--r--crates/rocie-cli/src/handle/mod.rs41
1 files changed, 23 insertions, 18 deletions
diff --git a/crates/rocie-cli/src/handle/mod.rs b/crates/rocie-cli/src/handle/mod.rs
index 4e63696..4e30f77 100644
--- a/crates/rocie-cli/src/handle/mod.rs
+++ b/crates/rocie-cli/src/handle/mod.rs
@@ -1,16 +1,17 @@
-use crate::cli::{BarcodeCommand, ProductCommand, UnitCommand, UnitPropertyCommand};
+use crate::cli::{BarcodeCommand, ProductCommand, UnitCommand, UnitPropertyCommand, UserCommand};
 
 use anyhow::{Context, Result};
 use rocie_client::{
     apis::{
-        api_get_inventory_api::amount_by_id,
-        api_get_product_api::{product_by_id, products_registered},
-        api_get_unit_api::{unit_by_id, units},
-        api_get_unit_property_api::{unit_properties, unit_property_by_id},
-        api_set_barcode_api::{buy_barcode, consume_barcode},
-        api_set_product_api::{associate_barcode, register_product},
-        api_set_unit_api::register_unit,
-        api_set_unit_property_api::register_unit_property,
+        api_get_auth_inventory_api::amount_by_id,
+        api_get_auth_product_api::{product_by_id, products_registered},
+        api_get_auth_unit_api::{unit_by_id, units},
+        api_get_auth_unit_property_api::{unit_properties, unit_property_by_id},
+        api_get_auth_user_api::users,
+        api_set_auth_barcode_api::{buy_barcode, consume_barcode},
+        api_set_auth_product_api::{associate_barcode, register_product},
+        api_set_auth_unit_api::register_unit,
+        api_set_auth_unit_property_api::register_unit_property,
         configuration::Configuration,
     },
     models::{
@@ -19,6 +20,16 @@ use rocie_client::{
     },
 };
 
+pub(crate) async fn user(config: &Configuration, command: UserCommand) -> Result<()> {
+    match command {
+        UserCommand::List {} => {
+            users(config).await?;
+        }
+    }
+
+    Ok(())
+}
+
 #[expect(clippy::too_many_lines)]
 pub(crate) async fn product(config: &Configuration, command: ProductCommand) -> Result<()> {
     match command {
@@ -227,15 +238,9 @@ pub(crate) async fn unit_property(
 ) -> Result<()> {
     match command {
         UnitPropertyCommand::Register { name, description } => {
-            let new_id = register_unit_property(
-                config,
-                UnitPropertyStub {
-                    description,
-                    name,
-                },
-            )
-            .await
-            .context("Failed to register unit property")?;
+            let new_id = register_unit_property(config, UnitPropertyStub { description, name })
+                .await
+                .context("Failed to register unit property")?;
             println!("Registered new unit property with id: {new_id}");
         }
         UnitPropertyCommand::List {} => {