Refactor breakRowIdField
This commit is contained in:
parent
f26a8d410a
commit
85827bbf93
|
@ -217,8 +217,7 @@ class InternalBuilder {
|
||||||
if (!opts.relationship && !isRelationshipField) {
|
if (!opts.relationship && !isRelationshipField) {
|
||||||
const alias = getTableAlias(tableName)
|
const alias = getTableAlias(tableName)
|
||||||
fn(alias ? `${alias}.${updatedKey}` : updatedKey, value)
|
fn(alias ? `${alias}.${updatedKey}` : updatedKey, value)
|
||||||
}
|
} else if (opts.relationship && isRelationshipField) {
|
||||||
if (opts.relationship && isRelationshipField) {
|
|
||||||
const [filterTableName, property] = updatedKey.split(".")
|
const [filterTableName, property] = updatedKey.split(".")
|
||||||
const alias = getTableAlias(filterTableName)
|
const alias = getTableAlias(filterTableName)
|
||||||
fn(alias ? `${alias}.${property}` : property, value)
|
fn(alias ? `${alias}.${property}` : property, value)
|
||||||
|
|
|
@ -116,6 +116,9 @@ export function breakRowIdField(_id: string | { _id: string }): any[] {
|
||||||
return Array.isArray(parsed) ? parsed : [parsed]
|
return Array.isArray(parsed) ? parsed : [parsed]
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// wasn't json - likely was handlebars for a many to many
|
// wasn't json - likely was handlebars for a many to many
|
||||||
|
if (Array.isArray(_id)) {
|
||||||
|
return _id
|
||||||
|
}
|
||||||
return [_id]
|
return [_id]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue