Skip to content

Commit b98c8b3

Browse files
vid277cdxker
authored andcommitted
refactor: rename update dataset configuration field to match_configuration
1 parent cc9d2a1 commit b98c8b3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

server/src/handlers/organization_handler.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ pub async fn remove_user_from_org(
435435
}))]
436436
pub struct UpdateAllOrgDatasetConfigsReqPayload {
437437
/// The configuration to provide a filter on what datasets to update.
438-
pub from_configuration: Option<serde_json::Value>,
438+
pub match_configuration: Option<serde_json::Value>,
439439
/// The new configuration for all datasets in the organization. Only the specified keys in the configuration object will be changed per dataset such that you can preserve dataset unique values.
440440
pub to_configuration: serde_json::Value,
441441
}
@@ -474,12 +474,12 @@ pub async fn update_all_org_dataset_configs(
474474
let req_payload = req_payload.into_inner();
475475

476476
let new_dataset_config = req_payload.to_configuration.clone();
477-
let from_configuration = req_payload.from_configuration.clone();
477+
let match_configuration = req_payload.match_configuration.clone();
478478

479479
update_all_org_dataset_configs_query(
480480
organization_id,
481481
new_dataset_config,
482-
from_configuration,
482+
match_configuration,
483483
pool,
484484
)
485485
.await?;

server/src/operators/organization_operator.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -990,16 +990,16 @@ pub async fn delete_actual_organization_query(
990990
pub async fn update_all_org_dataset_configs_query(
991991
org_id: uuid::Uuid,
992992
new_config: serde_json::Value,
993-
from_config: Option<serde_json::Value>,
993+
match_config: Option<serde_json::Value>,
994994
pool: web::Data<Pool>,
995995
) -> Result<(), ServiceError> {
996996
let mut concat_configs_raw_query = format!(
997997
"UPDATE datasets SET server_configuration = server_configuration || '{}' WHERE organization_id = '{}'",
998998
new_config.to_string().replace('\'', "''"), org_id
999999
);
10001000

1001-
if let Some(from_config) = from_config {
1002-
let from_config_query = from_config
1001+
if let Some(match_config) = match_config {
1002+
let match_config_query = match_config
10031003
.as_object()
10041004
.unwrap()
10051005
.iter()
@@ -1013,7 +1013,7 @@ pub async fn update_all_org_dataset_configs_query(
10131013
.collect::<Vec<String>>()
10141014
.join(" AND ");
10151015

1016-
concat_configs_raw_query.push_str(&format!(" AND ({})", from_config_query));
1016+
concat_configs_raw_query.push_str(&format!(" AND ({})", match_config_query));
10171017
}
10181018

10191019
concat_configs_raw_query.push(';');
@@ -1027,7 +1027,7 @@ pub async fn update_all_org_dataset_configs_query(
10271027
.await
10281028
.map_err(|e| {
10291029
log::error!(
1030-
"Error updating datasets in update_all_org_dataset_server_configs: {:?}",
1030+
"Error updating datasets in update_all_org_dataset_configs: {:?}",
10311031
e
10321032
);
10331033
ServiceError::BadRequest("Error updating datasets".to_string())

0 commit comments

Comments
 (0)