Only refresh tables when table ID changes

This commit is contained in:
Andrew Kingston 2021-09-23 17:04:12 +01:00
parent 6c8bff19e9
commit 13163102f8
1 changed files with 10 additions and 8 deletions

View File

@ -13,22 +13,24 @@
import { fetchTableData } from "helpers/fetchTableData"
import { Pagination } from "@budibase/bbui"
let hideAutocolumns = true
const data = fetchTableData()
let hideAutocolumns = true
$: isUsersTable = $tables.selected?._id === TableNames.USERS
$: title = $tables.selected?.name
$: schema = $tables.selected?.schema
$: type = $tables.selected?.type
$: isInternal = type !== "external"
$: fetchTable($tables.selected?._id)
// Fetch data whenever table changes
$: data.update({
tableId: $tables.selected?._id,
schema,
limit: 10,
paginate: true,
})
const fetchTable = tableId => {
data.update({
tableId,
schema,
limit: 10,
paginate: true,
})
}
// Fetch data whenever sorting option changes
const onSort = e => {