fixed another org id issue with merger
This commit is contained in:
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user