diff --git a/packages/builder/src/stores/backend/views.js b/packages/builder/src/stores/backend/views.js index a56ef51478..c7035c751c 100644 --- a/packages/builder/src/stores/backend/views.js +++ b/packages/builder/src/stores/backend/views.js @@ -41,7 +41,7 @@ export function createViewsStore() { } const create = async view => { - const savedView = await API.viewV2.create(view.tableId, view) + const savedView = await API.viewV2.create(view) // Update tables tables.update(state => { diff --git a/packages/frontend-core/src/api/viewsV2.js b/packages/frontend-core/src/api/viewsV2.js index 4282a2a3fb..09ed0170c3 100644 --- a/packages/frontend-core/src/api/viewsV2.js +++ b/packages/frontend-core/src/api/viewsV2.js @@ -4,9 +4,9 @@ export const buildViewV2Endpoints = API => ({ * @param tableId the id of the table where the view will be created * @param view the view object */ - create: async (tableId, view) => { + create: async view => { return await API.post({ - url: `/api/v2/views/${tableId}`, + url: `/api/v2/views`, body: view, }) }, @@ -15,8 +15,8 @@ export const buildViewV2Endpoints = API => ({ * @param tableId the id of the table * @param viewId the id of the view */ - fetch: async (tableId, viewId) => { - return await API.get({ url: `/api/v2/views/${tableId}/${viewId}/search` }) + fetch: async viewId => { + return await API.get({ url: `/api/v2/views/${viewId}/search` }) }, /** * Delete a view