diff --git a/packages/standard-components/src/DataTable.svelte b/packages/standard-components/src/DataTable.svelte index e6f097314c..6782a9925c 100644 --- a/packages/standard-components/src/DataTable.svelte +++ b/packages/standard-components/src/DataTable.svelte @@ -8,6 +8,16 @@ let headers = [] let store = _bb.store + const shouldDisplayField = name => { + if (name.startsWith("_")) return false + // always 'record' + if (name === "type") return false + // tables are always tied to a single modelId, this is irrelevant + if (name === "modelId") return false + + return true + } + async function fetchData() { const FETCH_RECORDS_URL = `/api/views/all_${model}` @@ -20,7 +30,7 @@ return state }) - headers = Object.keys(json[0]).filter(key => !key.startsWith("_")) + headers = Object.keys(json[0]).filter(shouldDisplayField) } else { throw new Error("Failed to fetch records.", response) }