Added unit to db and structs/types.

This commit is contained in:
2026-01-26 22:09:32 +01:00
parent 7879f69255
commit 8a27639aad
14 changed files with 243 additions and 60 deletions
+6
View File
@@ -16,6 +16,7 @@ use tower_http::cors::{AllowOrigin, Any, CorsLayer};
use tracing::info;
use http::header::{AUTHORIZATION, ACCEPT, ACCESS_CONTROL_ALLOW_ORIGIN, CONTENT_TYPE, ACCESS_CONTROL_ALLOW_CREDENTIALS};
use common::models::article;
use common::models::unit::Unit;
use common::models::variant::{delete_variant, insert_variant, update_variant, Variant};
#[tokio::main]
@@ -102,6 +103,7 @@ async fn get_article(
origin: Origin::EU,
description: None,
ingredients: None,
default_unit: Unit::G,
variants: vec![],
};
@@ -129,6 +131,7 @@ async fn create_article(
origin: Origin::EU,
description: None,
ingredients: None,
default_unit: Unit::G,
variants: vec![],
};
@@ -158,6 +161,7 @@ async fn update_article_route(
origin: Origin::EU,
description: None,
ingredients: None,
default_unit: Unit::G,
variants: vec![],
};
@@ -206,6 +210,7 @@ async fn add_variant(
name: None,
description: None,
ingredients: None,
unit: Unit::G,
};
(StatusCode::INTERNAL_SERVER_ERROR, Json(variant))
@@ -234,6 +239,7 @@ async fn update_variant_route(
name: None,
description: None,
ingredients: None,
unit: Unit::G,
};
(StatusCode::INTERNAL_SERVER_ERROR, Json(variant))