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