34 lines
841 B
Svelte
34 lines
841 B
Svelte
<script>
|
|
import { Body, ModalContent, notifications } from "@budibase/bbui"
|
|
import { plugins } from "stores/portal"
|
|
import { createEventDispatcher } from "svelte"
|
|
|
|
export let plugin
|
|
|
|
let dispatch = createEventDispatcher()
|
|
|
|
async function deletePlugin() {
|
|
try {
|
|
await plugins.deletePlugin(plugin._id)
|
|
notifications.success(`Plugin ${plugin?.name} deleted`)
|
|
dispatch("deleted")
|
|
} catch (error) {
|
|
const msg = error?.message ? error.message : JSON.stringify(error)
|
|
notifications.error(`Error deleting plugin: ${msg}`)
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<ModalContent
|
|
warning
|
|
onConfirm={deletePlugin}
|
|
title="Delete Plugin"
|
|
confirmText="Delete plugin"
|
|
cancelText="Cancel"
|
|
showCloseIcon={false}
|
|
>
|
|
<Body>
|
|
Are you sure you want to delete <strong>{plugin?.name}</strong>
|
|
</Body>
|
|
</ModalContent>
|