1
0
Fork 0
mirror of synced 2024-10-01 01:28:51 +13:00

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

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 => {