Update fetch row action to support views
This commit is contained in:
parent
5763a9843c
commit
d109411ed8
|
@ -1,21 +1,29 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select, Label } from "@budibase/bbui"
|
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"
|
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
export let bindings = []
|
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>
|
</script>
|
||||||
|
|
||||||
<div class="root">
|
<div class="root">
|
||||||
<Label>Table</Label>
|
<Label>Table</Label>
|
||||||
<Select
|
<Select
|
||||||
bind:value={parameters.tableId}
|
bind:value={parameters.tableId}
|
||||||
options={tableOptions}
|
{options}
|
||||||
getOptionLabel={table => table.name}
|
getOptionLabel={table => table.label}
|
||||||
getOptionValue={table => table._id}
|
getOptionValue={table => table.resourceId}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Label small>Row ID</Label>
|
<Label small>Row ID</Label>
|
||||||
|
|
Loading…
Reference in New Issue