Fix refreshing table definition
This commit is contained in:
parent
deb4092cd3
commit
24182b3f1b
|
@ -11,5 +11,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal bind:this={modal}>
|
<Modal bind:this={modal}>
|
||||||
<CreateEditColumn on:updatecolumns={rows.actions.refreshTableDefinition} />
|
<CreateEditColumn
|
||||||
|
on:updatecolumns={rows.actions.refreshDatasourceDefinition}
|
||||||
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -482,9 +482,14 @@ export const createActions = context => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refreshes the schema of the data fetch subscription
|
// Refreshes the schema of the data fetch subscription
|
||||||
const refreshTableDefinition = async () => {
|
const refreshDatasourceDefinition = async () => {
|
||||||
const definition = await API.fetchTableDefinition(get(tableId))
|
const $datasource = get(datasource)
|
||||||
table.set(definition)
|
if ($datasource.type === "table") {
|
||||||
|
table.set(await API.fetchTableDefinition($datasource.tableId))
|
||||||
|
} else if ($datasource.type === "viewV2") {
|
||||||
|
// const definition = await API.viewsV2.(get(tableId))
|
||||||
|
// table.set(definition)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks if we have a row with a certain ID
|
// Checks if we have a row with a certain ID
|
||||||
|
@ -520,7 +525,7 @@ export const createActions = context => {
|
||||||
refreshRow,
|
refreshRow,
|
||||||
replaceRow,
|
replaceRow,
|
||||||
refreshData,
|
refreshData,
|
||||||
refreshTableDefinition,
|
refreshDatasourceDefinition,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue