1
0
Fork 0
mirror of synced 2024-10-04 03:54:37 +13:00

Update fetch row action to support views

This commit is contained in:
Andrew Kingston 2023-08-24 16:16:28 +01:00
parent 5763a9843c
commit d109411ed8

View file

@ -1,21 +1,29 @@
<script>
import { Select, Label } from "@budibase/bbui"
import { tables } from "stores/backend"
import { tables, viewsV2 } from "stores/backend"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
export let parameters
export let bindings = []
$: tableOptions = $tables.list || []
$: tableOptions = $tables.list.map(table => ({
label: table.name,
resourceId: table._id,
}))
$: viewOptions = $viewsV2.list.map(view => ({
label: view.name,
resourceId: view.id,
}))
$: options = [...(tableOptions || []), ...(viewOptions || [])]
</script>
<div class="root">
<Label>Table</Label>
<Select
bind:value={parameters.tableId}
options={tableOptions}
getOptionLabel={table => table.name}
getOptionValue={table => table._id}
{options}
getOptionLabel={table => table.label}
getOptionValue={table => table.resourceId}
/>
<Label small>Row ID</Label>