Add delete button
This commit is contained in:
parent
52c8fda064
commit
f2881fc714
|
@ -67,7 +67,7 @@
|
|||
{/if}
|
||||
{:else if schema.type === QueryTypes.FLOW}
|
||||
<br />
|
||||
{#if !query.fields.steps}
|
||||
{#if query.fields.steps?.length == 0}
|
||||
<div class="controls">
|
||||
<Button
|
||||
secondary
|
||||
|
@ -91,7 +91,14 @@
|
|||
<div class="blockSection">
|
||||
<div class="block-options">
|
||||
Stage {index + 1}
|
||||
<ActionButton on:click={() => {}} icon="DeleteOutline" />
|
||||
<ActionButton
|
||||
on:click={() => {
|
||||
query.fields.steps = [
|
||||
...query.fields.steps.splice(index, 1),
|
||||
]
|
||||
}}
|
||||
icon="DeleteOutline"
|
||||
/>
|
||||
</div>
|
||||
<Layout noPadding gap="S">
|
||||
<div class="fields">
|
||||
|
|
|
@ -52,7 +52,7 @@ module MongoDBModule {
|
|||
},
|
||||
aggregate: {
|
||||
type: QueryType.FLOW,
|
||||
}
|
||||
},
|
||||
},
|
||||
extra: {
|
||||
collection: {
|
||||
|
@ -327,11 +327,13 @@ module MongoDBModule {
|
|||
const db = this.client.db(this.config.db)
|
||||
const collection = db.collection(query.extra.collection)
|
||||
let response = {}
|
||||
for await (const doc of collection.aggregate(query.steps.map(({ key, value }) => {
|
||||
let temp:any = {}
|
||||
temp[key] = JSON.parse(value.value)
|
||||
return temp
|
||||
}))) {
|
||||
for await (const doc of collection.aggregate(
|
||||
query.steps.map(({ key, value }) => {
|
||||
let temp: any = {}
|
||||
temp[key] = JSON.parse(value.value)
|
||||
return temp
|
||||
})
|
||||
)) {
|
||||
response = doc
|
||||
}
|
||||
return response
|
||||
|
|
Loading…
Reference in New Issue