Skip to content

Commit a9dbd1f

Browse files
authored
fix: Missing app policy for datatable (#7944)
1 parent 6215760 commit a9dbd1f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

frontend/src/lib/components/apps/editor/appPolicy.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,18 @@ export async function updatePolicy(app: App, currentPolicy: Policy | undefined):
4747
let nr: { id: string; input: AppInput }[] = []
4848
let config = c.configuration as any
4949

50-
const dbType = config?.type?.selected as DbType
51-
let pg = config?.type?.configuration?.[dbType]
50+
const dbType = (
51+
config?.type?.selected === 'datatable' ? 'postgresql' : config?.type?.selected
52+
) as DbType
53+
let pg = config?.type?.configuration?.[config?.type?.selected]
5254

5355
if (pg && dbType) {
54-
const { table, resource, ducklake } = pg
56+
const { table, resource, ducklake, datatable } = pg
5557
const tableValue = table.value
5658
const dbPath =
5759
resource?.value.split('$res:')[1] ??
58-
(ducklake?.value as string | undefined)?.split('ducklake://')[1]
60+
(ducklake?.value as string | undefined)?.split('ducklake://')[1] ??
61+
datatable?.value
5962
const columnDefs = (c.configuration.columnDefs as any).value as ColumnDef[]
6063
const whereClause = (c.configuration.whereClause as any).value as unknown as
6164
| string

0 commit comments

Comments
 (0)