From 08829d4defdcb1eaeae79b69d14d0734ab6616cc Mon Sep 17 00:00:00 2001 From: Fran Domovic Date: Tue, 25 Jun 2024 16:42:47 +0200 Subject: [PATCH] feat: update context details return type --- crates/server/src/admin/handlers/context.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/server/src/admin/handlers/context.rs b/crates/server/src/admin/handlers/context.rs index 23ef17f28..020b49fe6 100644 --- a/crates/server/src/admin/handlers/context.rs +++ b/crates/server/src/admin/handlers/context.rs @@ -14,9 +14,14 @@ use crate::admin::service::{parse_api_error, AdminState, ApiError, ApiResponse}; use crate::admin::storage::client_keys::get_context_client_key; use crate::admin::storage::context::{add_context, delete_context, get_context, get_contexts}; +#[derive(Debug, Serialize, Deserialize)] +pub struct ContextObject { + context: Context, +} + #[derive(Debug, Serialize, Deserialize)] pub struct GetContextResponse { - data: Context, + data: ContextObject, } pub async fn get_context_handler( @@ -29,7 +34,7 @@ pub async fn get_context_handler( match context_result { Ok(ctx) => match ctx { Some(context) => ApiResponse { - payload: GetContextResponse { data: context }, + payload: GetContextResponse { data: ContextObject { context } }, } .into_response(), None => ApiError {