about summary refs log tree commit diff stats
path: root/crates/rocie-server/src/api/set/product.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-09-23 17:16:23 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-09-23 17:16:23 +0200
commite536cb326a67fffd511ead4a87655ca5ef98bf29 (patch)
tree96deb4e27b25c1e82a5d8b2be01aed650521bfc7 /crates/rocie-server/src/api/set/product.rs
parentchore(crates/rocies-client): Regenerate (diff)
downloadserver-e536cb326a67fffd511ead4a87655ca5ef98bf29.zip
feat(crates/rocies-server): Don't make the newtype wrappers transparent in the openapi spec
This makes using the generated code significantly easier and type safer.
Diffstat (limited to 'crates/rocie-server/src/api/set/product.rs')
-rw-r--r--crates/rocie-server/src/api/set/product.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/rocie-server/src/api/set/product.rs b/crates/rocie-server/src/api/set/product.rs
index 19024c7..d347ee7 100644
--- a/crates/rocie-server/src/api/set/product.rs
+++ b/crates/rocie-server/src/api/set/product.rs
@@ -7,7 +7,7 @@ use crate::{
     storage::sql::{
         barcode::Barcode,
         insert::Operations,
-        product::{Product, ProductId},
+        product::{Product, ProductId, ProductIdStub},
         unit::Unit,
     },
 };
@@ -84,7 +84,7 @@ pub(crate) async fn register_product(
 #[post("/product/{id}/associate")]
 pub(crate) async fn associate_barcode(
     app: web::Data<App>,
-    id: web::Path<ProductId>,
+    id: web::Path<ProductIdStub>,
     barcode: web::Json<Barcode>,
 ) -> Result<impl Responder> {
     let mut ops = Operations::new("associated barcode with product");
@@ -97,7 +97,7 @@ pub(crate) async fn associate_barcode(
         }
     }
 
-    match Product::from_id(&app, id.into_inner()).await? {
+    match Product::from_id(&app, id.into_inner().into()).await? {
         Some(product) => {
             product.associate_barcode(barcode.into_inner(), &mut ops);