Fix fetch
This commit is contained in:
parent
2c1aae9705
commit
48e966d5d6
|
@ -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 => {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue