diff --git a/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte b/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte index ea4185bd93..971afcf3b0 100644 --- a/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte +++ b/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte @@ -33,6 +33,17 @@ ) } + const deleteRecord = async row => { + open( + DeleteRecordModal, + { + onClosed: close, + record: await selectRecord(row), + }, + { styleContent: { padding: "0" } } + ) + } + async function selectRecord(record) { return await api.loadRecord(record.key, { appname: $store.appname, @@ -154,8 +165,7 @@
  • { - selectRecord(row) - backendUiStore.actions.modals.show('DELETE_RECORD') + deleteRecord(row) }}> Delete
    diff --git a/packages/builder/src/components/database/ModelDataTable/modals/DeleteRecord.svelte b/packages/builder/src/components/database/ModelDataTable/modals/DeleteRecord.svelte index b3cbfb2e60..fc27c6566f 100644 --- a/packages/builder/src/components/database/ModelDataTable/modals/DeleteRecord.svelte +++ b/packages/builder/src/components/database/ModelDataTable/modals/DeleteRecord.svelte @@ -4,26 +4,25 @@ import * as api from "../api" export let record + export let onClosed $: currentAppInfo = { appname: $store.appname, instanceId: $backendUiStore.selectedDatabase.id, } - - function onClosed() { - backendUiStore.actions.modals.hide() - }
    - - -

    Delete Record

    -
    -

    - Are you sure you want to delete this record? All of your data will be - permanently removed. This action cannot be undone. -

    +
    + + +

    Delete Record

    +
    +

    + Are you sure you want to delete this record? All of your data will be + permanently removed. This action cannot be undone. +

    +