From b46686098486bdd7bddfe58354e3fc29898746db Mon Sep 17 00:00:00 2001 From: stack72 Date: Sun, 23 Jun 2024 16:51:05 +0100 Subject: [PATCH] fix(sdf): Ensure we pass correct variant display_name on update --- app/web/src/components/AssetDetailsPanel.vue | 3 ++- lib/sdf-server/src/server/service/variant/get_variant.rs | 4 ++-- lib/sdf-server/src/server/service/variant/update_variant.rs | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/web/src/components/AssetDetailsPanel.vue b/app/web/src/components/AssetDetailsPanel.vue index 99e99adf6a..6b69c42cf1 100644 --- a/app/web/src/components/AssetDetailsPanel.vue +++ b/app/web/src/components/AssetDetailsPanel.vue @@ -65,8 +65,9 @@ placeholder="(mandatory) Provide the asset a name" @blur="updateAsset" /> + , + pub display_name: Option, pub category: String, pub color: String, pub link: Option, @@ -65,7 +65,7 @@ pub async fn get_variant( id: request.id, default_schema_variant_id, name: schema.name().into(), - menu_name: variant.display_name(), + display_name: variant.display_name(), category: variant.category().into(), color: variant.get_color(&ctx).await?, link: variant.link(), diff --git a/lib/sdf-server/src/server/service/variant/update_variant.rs b/lib/sdf-server/src/server/service/variant/update_variant.rs index 65b0159211..cf8702a589 100644 --- a/lib/sdf-server/src/server/service/variant/update_variant.rs +++ b/lib/sdf-server/src/server/service/variant/update_variant.rs @@ -16,7 +16,7 @@ pub struct UpdateVariantRequest { pub id: SchemaId, pub default_schema_variant_id: SchemaVariantId, pub name: String, - pub menu_name: Option, + pub display_name: Option, pub category: String, pub color: String, pub link: Option, @@ -41,7 +41,7 @@ pub async fn update_variant( &ctx, request.default_schema_variant_id, request.name.clone(), - request.menu_name.clone(), + request.display_name.clone(), request.category.clone(), request.color, request.link, @@ -59,7 +59,7 @@ pub async fn update_variant( serde_json::json!({ "variant_name": request.name.clone(), "variant_category": request.category.clone(), - "variant_menu_name": request.menu_name.clone(), + "variant_menu_name": request.display_name.clone(), "variant_id": updated_schema_variant_id, }), );