Filter 'link' fields from the Current User bindings
This commit is contained in:
parent
e387ee2591
commit
5f7cfb5731
|
@ -393,20 +393,25 @@ export const getUserBindings = () => {
|
||||||
const { schema } = getSchemaForTable(TableNames.USERS)
|
const { schema } = getSchemaForTable(TableNames.USERS)
|
||||||
const keys = Object.keys(schema).sort()
|
const keys = Object.keys(schema).sort()
|
||||||
const safeUser = makePropSafe("user")
|
const safeUser = makePropSafe("user")
|
||||||
keys.forEach(key => {
|
|
||||||
|
bindings = keys.reduce((acc, key) => {
|
||||||
const fieldSchema = schema[key]
|
const fieldSchema = schema[key]
|
||||||
bindings.push({
|
if (fieldSchema.type !== "link") {
|
||||||
type: "context",
|
acc.push({
|
||||||
runtimeBinding: `${safeUser}.${makePropSafe(key)}`,
|
type: "context",
|
||||||
readableBinding: `Current User.${key}`,
|
runtimeBinding: `${safeUser}.${makePropSafe(key)}`,
|
||||||
// Field schema and provider are required to construct relationship
|
readableBinding: `Current User.${key}`,
|
||||||
// datasource options, based on bindable properties
|
// Field schema and provider are required to construct relationship
|
||||||
fieldSchema,
|
// datasource options, based on bindable properties
|
||||||
providerId: "user",
|
fieldSchema,
|
||||||
category: "Current User",
|
providerId: "user",
|
||||||
icon: "User",
|
category: "Current User",
|
||||||
})
|
icon: "User",
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
return acc
|
||||||
|
}, [])
|
||||||
|
|
||||||
return bindings
|
return bindings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue