Add types
This commit is contained in:
parent
875623661e
commit
694dc78c0f
|
@ -16,7 +16,7 @@
|
||||||
import { ValidSnippetNameRegex } from "@budibase/shared-core"
|
import { ValidSnippetNameRegex } from "@budibase/shared-core"
|
||||||
import type { Snippet } from "@budibase/types"
|
import type { Snippet } from "@budibase/types"
|
||||||
|
|
||||||
export let snippet
|
export let snippet: Snippet | null
|
||||||
|
|
||||||
export const show = () => drawer.show()
|
export const show = () => drawer.show()
|
||||||
export const hide = () => drawer.hide()
|
export const hide = () => drawer.hide()
|
||||||
|
@ -54,7 +54,9 @@
|
||||||
const deleteSnippet = async () => {
|
const deleteSnippet = async () => {
|
||||||
loading = true
|
loading = true
|
||||||
try {
|
try {
|
||||||
|
if (snippet) {
|
||||||
await snippets.deleteSnippet(snippet.name)
|
await snippets.deleteSnippet(snippet.name)
|
||||||
|
}
|
||||||
drawer.hide()
|
drawer.hide()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notifications.error("Error deleting snippet")
|
notifications.error("Error deleting snippet")
|
||||||
|
|
Loading…
Reference in New Issue