1
0
Fork 0
mirror of synced 2024-10-06 04:54:52 +13:00

Strip hidden fields from viewV2 schema in client lib

This commit is contained in:
Andrew Kingston 2023-08-09 16:30:27 +01:00
parent 08b348c1d4
commit 7a40ad66c6

View file

@ -51,6 +51,15 @@ export const fetchDatasourceSchema = async (
return null
}
// Strip hidden fields from views
if (datasource.type === "viewV2") {
Object.keys(schema).forEach(field => {
if (!schema[field].visible) {
delete schema[field]
}
})
}
// Enrich schema with relationships if required
if (definition?.sql && options?.enrichRelationships) {
const relationshipAdditions = await getRelationshipSchemaAdditions(schema)