Filter 'link' fields from the Current User bindings
This commit is contained in:
parent
7e7d0bb867
commit
a6cee09812
|
@ -393,9 +393,11 @@ 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") {
|
||||||
|
acc.push({
|
||||||
type: "context",
|
type: "context",
|
||||||
runtimeBinding: `${safeUser}.${makePropSafe(key)}`,
|
runtimeBinding: `${safeUser}.${makePropSafe(key)}`,
|
||||||
readableBinding: `Current User.${key}`,
|
readableBinding: `Current User.${key}`,
|
||||||
|
@ -406,7 +408,10 @@ export const getUserBindings = () => {
|
||||||
category: "Current User",
|
category: "Current User",
|
||||||
icon: "User",
|
icon: "User",
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
return acc
|
||||||
|
}, [])
|
||||||
|
|
||||||
return bindings
|
return bindings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue