Browse Source

DataTable should not display type & modelId

pull/4023/head
Michael Shanks 6 years ago
parent
commit
2a7926a677
  1. 12
      packages/standard-components/src/DataTable.svelte

12
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)
}

Loading…
Cancel
Save