1
0
Fork 0
mirror of synced 2024-09-19 02:39:37 +12:00
budibase/packages/builder/src/components/backend/DataTable/ExternalDataSourceTable.svelte

33 lines
804 B
Svelte
Raw Normal View History

2020-11-27 03:43:56 +13:00
<script>
import { backendUiStore } from "builderStore"
import * as api from "./api"
import Table from "./Table.svelte"
import EditIntegrationConfigButton from "./buttons/EditIntegrationConfigButton.svelte"
let data = []
let loading = false
$: table = $backendUiStore.selectedTable
$: title = table.name
$: schema = table.schema
$: tableView = {
schema,
name: $backendUiStore.selectedView.name,
}
// Fetch rows for specified table
$: {
if ($backendUiStore.selectedView?.name?.startsWith("all_")) {
loading = true
api.fetchDataForView($backendUiStore.selectedView).then(rows => {
data = rows || []
loading = false
})
}
}
</script>
2020-11-27 05:46:36 +13:00
<Table {title} {schema} {data} {loading}>
2020-11-27 03:43:56 +13:00
<EditIntegrationConfigButton {table} />
</Table>