diff options
Diffstat (limited to 'crates/rocie-server/src/api/get/product.rs')
| -rw-r--r-- | crates/rocie-server/src/api/get/product.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/rocie-server/src/api/get/product.rs b/crates/rocie-server/src/api/get/product.rs index c496777..90cb8c8 100644 --- a/crates/rocie-server/src/api/get/product.rs +++ b/crates/rocie-server/src/api/get/product.rs @@ -2,7 +2,7 @@ use actix_web::{HttpResponse, Responder, Result, get, web}; use crate::{ app::App, - storage::sql::product::{Product, ProductId}, + storage::sql::product::{Product, ProductId, ProductIdStub}, }; /// Get Product by id @@ -19,11 +19,11 @@ use crate::{ #[get("/product/{id}")] pub(crate) async fn product_by_id( app: web::Data<App>, - id: web::Path<ProductId>, + id: web::Path<ProductIdStub>, ) -> Result<impl Responder> { let id = id.into_inner(); - match Product::from_id(&app, id).await? { + match Product::from_id(&app, id.into()).await? { Some(product) => Ok(HttpResponse::Ok().json(product)), None => Ok(HttpResponse::NotFound().finish()), } |
