allow deletion of queries and datasources
This commit is contained in:
parent
04eca5b663
commit
66fccccc1e
|
@ -47,5 +47,6 @@
|
|||
|
||||
.close {
|
||||
font-size: var(--font-size-xl);
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { Button, Icon, DropdownMenu, Spacer, Heading } from "@budibase/bbui"
|
||||
import { createEventDispatcher } from "svelte"
|
||||
import { store, backendUiStore, currentAsset } from "builderStore"
|
||||
// import DataBindingDrawer from "components/userInterface/DataBindingDrawer/index.svelte"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import BottomDrawer from "components/common/BottomDrawer.svelte"
|
||||
import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte"
|
||||
import fetchBindableProperties from "../../builderStore/fetchBindableProperties"
|
||||
|
@ -92,7 +92,10 @@
|
|||
{#if bindingDrawerOpen}
|
||||
<BottomDrawer title={'Query'} onClose={closeDatabindingDrawer}>
|
||||
<div slot="buttons">
|
||||
<Button blue thin on:click={() => handleSelected(value)}>Save</Button>
|
||||
<Button blue thin on:click={() => {
|
||||
notifier.success("Query parameters saved.")
|
||||
handleSelected(value)
|
||||
}}>Save</Button>
|
||||
</div>
|
||||
<div class="drawer-contents" slot="body">
|
||||
<pre>{value.queryString}</pre>
|
||||
|
|
|
@ -66,7 +66,7 @@ exports.destroy = async function(ctx) {
|
|||
await db.bulkDocs(rows.rows.map(row => ({ ...row.doc, _deleted: true })))
|
||||
|
||||
// delete the datasource
|
||||
await db.destroy(ctx.params.datasourceId)
|
||||
await db.remove(ctx.params.datasourceId)
|
||||
|
||||
ctx.message = `Datasource deleted.`
|
||||
ctx.status = 200
|
||||
|
|
|
@ -79,7 +79,7 @@ exports.execute = async function(ctx) {
|
|||
|
||||
exports.destroy = async function(ctx) {
|
||||
const db = new CouchDB(ctx.user.appId)
|
||||
await db.destroy(ctx.params.queryId)
|
||||
await db.remove(ctx.params.queryId)
|
||||
ctx.message = `Query deleted.`
|
||||
ctx.status = 200
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue