Add types

This commit is contained in:
Adria Navarro 2025-02-21 11:50:01 +01:00
parent 875623661e
commit 694dc78c0f
1 changed files with 4 additions and 2 deletions

View File

@ -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 {
await snippets.deleteSnippet(snippet.name) if (snippet) {
await snippets.deleteSnippet(snippet.name)
}
drawer.hide() drawer.hide()
} catch (error) { } catch (error) {
notifications.error("Error deleting snippet") notifications.error("Error deleting snippet")