Skip to content

Commit

Permalink
fix: remove change reason
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikmishra356 committed Feb 21, 2025
1 parent 7a4ae8f commit 4cbff15
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions crates/context_aware_config/src/api/config/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use uuid::Uuid;

use crate::{api::context::PutReq, helpers::generate_cac};
use crate::{
api::context::{self, helpers::ensure_description},
api::context::{self, helpers::query_description},
helpers::DimensionData,
};
use crate::{
Expand Down Expand Up @@ -501,7 +501,7 @@ async fn reduce_config_key(
if let Ok(put_req) = construct_new_payload(request_payload) {
let description = match put_req.description.clone() {
Some(val) => val,
None => ensure_description(
None => query_description(
Value::Object(
put_req.context.clone().into_inner().into(),
),
Expand Down
12 changes: 6 additions & 6 deletions crates/context_aware_config/src/api/context/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
api::{
context::{
hash,
helpers::ensure_description,
helpers::query_description,
operations,
types::{
ContextAction, ContextBulkResponse, ContextFilterSortOn, ContextFilters,
Expand Down Expand Up @@ -69,7 +69,7 @@ async fn put_handler(
let tags = parse_config_tags(custom_headers.config_tags)?;
let description = match req.description.clone() {
Some(val) => val,
None => ensure_description(
None => query_description(
Value::Object(req.context.clone().into_inner().into()),
&mut db_conn,
&schema_name,
Expand Down Expand Up @@ -132,7 +132,7 @@ async fn update_override_handler(
let tags = parse_config_tags(custom_headers.config_tags)?;
let description = match req.description.clone() {
Some(val) => val,
None => ensure_description(
None => query_description(
Value::Object(req.context.clone().into_inner().into()),
&mut db_conn,
&schema_name,
Expand Down Expand Up @@ -193,7 +193,7 @@ async fn move_handler(

let description = match req.description.clone() {
Some(val) => val,
None => ensure_description(
None => query_description(
Value::Object(req.context.clone().into_inner().into()),
&mut db_conn,
&schema_name,
Expand Down Expand Up @@ -437,7 +437,7 @@ async fn bulk_operations(
Value::Object(ctx_condition.clone().into());

let description = if put_req.description.is_none() {
ensure_description(
query_description(
ctx_condition_value.clone(),
transaction_conn,
&schema_name,
Expand Down Expand Up @@ -533,7 +533,7 @@ async fn bulk_operations(
ContextAction::Move((old_ctx_id, move_req)) => {
let description = match move_req.description.clone() {
Some(val) => val,
None => ensure_description(
None => query_description(
Value::Object(
move_req.context.clone().into_inner().into(),
),
Expand Down
2 changes: 1 addition & 1 deletion crates/context_aware_config/src/api/context/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ pub fn validate_value_with_function(
Ok(())
}

pub fn ensure_description(
pub fn query_description(
context: Value,
transaction_conn: &mut diesel::PgConnection,
schema_name: &SchemaName,
Expand Down
2 changes: 1 addition & 1 deletion crates/context_aware_config/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ pub fn add_config_version(
config_hash,
tags,
created_at: Utc::now().naive_utc(),
change_reason: description,
description,
};
diesel::insert_into(config_versions)
.values(&config_version)
Expand Down
2 changes: 1 addition & 1 deletion crates/superposition_types/src/database/models/cac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub struct ConfigVersion {
pub config_hash: String,
pub tags: Option<Vec<String>>,
pub created_at: NaiveDateTime,
pub change_reason: String,
pub description: String,
}

#[derive(Serialize, Deserialize, Clone, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion crates/superposition_types/src/database/schema.patch
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ index bd298000..4772a860 100644
+ mandatory_dimensions -> Nullable<Array<Text>>,
}
}
}
}
2 changes: 1 addition & 1 deletion crates/superposition_types/src/database/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ diesel::table! {
config_hash -> Text,
tags -> Nullable<Array<Varchar>>,
created_at -> Timestamp,
change_reason -> Text,
description -> Text,
}
}

Expand Down

0 comments on commit 4cbff15

Please sign in to comment.