From 123be842fb517c3532cb93b9eefce5869bd7e4e1 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 14 Aug 2023 16:20:16 +0100 Subject: [PATCH] Update deleting rows from views --- .../frontend-core/src/components/grid/stores/viewV2.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/viewV2.js b/packages/frontend-core/src/components/grid/stores/viewV2.js index f9efc6ffb0..5bf27b5b56 100644 --- a/packages/frontend-core/src/components/grid/stores/viewV2.js +++ b/packages/frontend-core/src/components/grid/stores/viewV2.js @@ -33,8 +33,12 @@ export const createActions = context => { } const deleteRows = async rows => { - await API.viewV2.deleteRows({ - viewId: get(datasource).id, + // Ensure we delete _viewId from rows as otherwise this throws a 500 + rows?.forEach(row => { + delete row?._viewId + }) + await API.deleteRows({ + tableId: get(datasource).id, rows, }) }