diff --git a/packages/builder/src/components/backend/DataTable/RelationshipDataTable.svelte b/packages/builder/src/components/backend/DataTable/RelationshipDataTable.svelte index a0a06d1866..8ef870caca 100644 --- a/packages/builder/src/components/backend/DataTable/RelationshipDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/RelationshipDataTable.svelte @@ -1,7 +1,8 @@ diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index 3c646bde68..ab94080959 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -2,7 +2,7 @@ import { fade } from "svelte/transition" import { goto, params } from "@roxi/routify" import { Table, Modal, Heading, notifications, Layout } from "@budibase/bbui" - import api from "builderStore/api" + import { API } "api" import Spinner from "components/common/Spinner.svelte" import DeleteRowsButton from "./buttons/DeleteRowsButton.svelte" import CreateEditRow from "./modals/CreateEditRow.svelte" @@ -88,12 +88,17 @@ } const deleteRows = async () => { - await api.delete(`/api/${tableId}/rows`, { - rows: selectedRows, - }) - data = data.filter(row => !selectedRows.includes(row)) - notifications.success(`Successfully deleted ${selectedRows.length} rows`) - selectedRows = [] + try { + await API.deleteRows({ + tableId, + rows: selectedRows + }) + data = data.filter(row => !selectedRows.includes(row)) + notifications.success(`Successfully deleted ${selectedRows.length} rows`) + selectedRows = [] + } catch (error) { + notifications.error("Error deleting rows") + } } const editRow = row => { diff --git a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte index a52fbdb177..10c6703623 100644 --- a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte @@ -1,5 +1,5 @@ diff --git a/packages/builder/src/components/backend/DataTable/modals/EditRoles.svelte b/packages/builder/src/components/backend/DataTable/modals/EditRoles.svelte index 7fa9482fbe..e2ccab11af 100644 --- a/packages/builder/src/components/backend/DataTable/modals/EditRoles.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/EditRoles.svelte @@ -1,7 +1,7 @@ diff --git a/packages/builder/src/components/backend/DataTable/modals/ImportModal.svelte b/packages/builder/src/components/backend/DataTable/modals/ImportModal.svelte index 88d001a444..930842d34f 100644 --- a/packages/builder/src/components/backend/DataTable/modals/ImportModal.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/ImportModal.svelte @@ -1,7 +1,7 @@ diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/index.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/index.svelte index 79ebdb1020..9277207e37 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/index.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/index.svelte @@ -1,7 +1,7 @@ diff --git a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte index 44cb374092..774aac0677 100644 --- a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte +++ b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte @@ -1,7 +1,7 @@