1
0
Fork 0
mirror of synced 2024-07-06 15:00:49 +12:00

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 savedView = await API.viewV2.create(view.tableId, view)
const savedView = await API.viewV2.create(view)
// Update tables
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 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