From 0b17d6026ac5d282cb4b7e110aa954aba3fbf092 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 19 Jul 2023 23:07:40 +0200 Subject: [PATCH] Fix delete --- packages/builder/src/stores/backend/views.js | 2 +- packages/frontend-core/src/api/viewsV2.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/stores/backend/views.js b/packages/builder/src/stores/backend/views.js index c7035c751c..0ddda1f415 100644 --- a/packages/builder/src/stores/backend/views.js +++ b/packages/builder/src/stores/backend/views.js @@ -27,7 +27,7 @@ export function createViewsStore() { const deleteView = async view => { if (view.version === 2) { - await API.viewV2.delete(view._id) + await API.viewV2.delete(view.id) } else { await API.deleteView(view.name) } diff --git a/packages/frontend-core/src/api/viewsV2.js b/packages/frontend-core/src/api/viewsV2.js index 09ed0170c3..98245430d8 100644 --- a/packages/frontend-core/src/api/viewsV2.js +++ b/packages/frontend-core/src/api/viewsV2.js @@ -23,7 +23,7 @@ export const buildViewV2Endpoints = API => ({ * @param tableId the id of the table * @param viewId the id of the view */ - delete: async (tableId, viewId) => { - return await API.delete({ url: `/api/v2/views/${tableId}/${viewId}` }) + delete: async viewId => { + return await API.delete({ url: `/api/v2/views/${viewId}` }) }, })