1
0
Fork 0
mirror of synced 2024-06-18 18:35:37 +12:00

allow deletion of queries and datasources

This commit is contained in:
Martin McKeaveney 2021-01-12 17:04:51 +00:00
parent 04eca5b663
commit 66fccccc1e
4 changed files with 8 additions and 4 deletions

View file

@ -47,5 +47,6 @@
.close {
font-size: var(--font-size-xl);
cursor: pointer;
}
</style>

View file

@ -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>

View file

@ -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

View file

@ -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
}