Fix fetch

This commit is contained in:
Adria Navarro 2023-07-19 23:06:08 +02:00
parent 2c1aae9705
commit 48e966d5d6
2 changed files with 5 additions and 5 deletions

View File

@ -41,7 +41,7 @@ export function createViewsStore() {
} }
const create = async view => { const create = async view => {
const savedView = await API.viewV2.create(view.tableId, view) const savedView = await API.viewV2.create(view)
// Update tables // Update tables
tables.update(state => { tables.update(state => {

View File

@ -4,9 +4,9 @@ export const buildViewV2Endpoints = API => ({
* @param tableId the id of the table where the view will be created * @param tableId the id of the table where the view will be created
* @param view the view object * @param view the view object
*/ */
create: async (tableId, view) => { create: async view => {
return await API.post({ return await API.post({
url: `/api/v2/views/${tableId}`, url: `/api/v2/views`,
body: view, body: view,
}) })
}, },
@ -15,8 +15,8 @@ export const buildViewV2Endpoints = API => ({
* @param tableId the id of the table * @param tableId the id of the table
* @param viewId the id of the view * @param viewId the id of the view
*/ */
fetch: async (tableId, viewId) => { fetch: async viewId => {
return await API.get({ url: `/api/v2/views/${tableId}/${viewId}/search` }) return await API.get({ url: `/api/v2/views/${viewId}/search` })
}, },
/** /**
* Delete a view * Delete a view