fixed another org id issue with merger

This commit is contained in:
2026-05-13 16:31:06 -04:00
parent 777fc8bbf8
commit c129864c89
2 changed files with 20 additions and 6 deletions

View File

@ -135,14 +135,18 @@ impl Merger {
schema: &Arc<crate::database::schema::Schema>,
) {
if !relative.contains_key("organization_id") {
if let Some(org_id) = entity_fields.get("organization_id") {
if let Some(compiled_props) = schema.obj.compiled_properties.get() {
if let Some(org_schema) = compiled_props.get("organization_id") {
if org_schema.obj.const_.is_some() {
return;
}
let mut const_val: Option<Value> = None;
if let Some(compiled_props) = schema.obj.compiled_properties.get() {
if let Some(org_schema) = compiled_props.get("organization_id") {
if let Some(c) = &org_schema.obj.const_ {
const_val = Some(c.clone());
}
}
}
if let Some(c) = const_val {
relative.insert("organization_id".to_string(), c);
} else if let Some(org_id) = entity_fields.get("organization_id") {
relative.insert("organization_id".to_string(), org_id.clone());
}
}