Setup api
This commit is contained in:
parent
82ea9a7cc1
commit
701772ebd5
|
@ -23,6 +23,7 @@ import { buildTemplateEndpoints } from "./templates"
|
|||
import { buildUserEndpoints } from "./user"
|
||||
import { buildSelfEndpoints } from "./self"
|
||||
import { buildViewEndpoints } from "./views"
|
||||
import { buildViewV2Endpoints } from "./viewsV2"
|
||||
import { buildLicensingEndpoints } from "./licensing"
|
||||
import { buildGroupsEndpoints } from "./groups"
|
||||
import { buildPluginEndpoints } from "./plugins"
|
||||
|
@ -279,5 +280,6 @@ export const createAPIClient = config => {
|
|||
...buildEventEndpoints(API),
|
||||
...buildAuditLogsEndpoints(API),
|
||||
...buildLogsEndpoints(API),
|
||||
viewV2: buildViewV2Endpoints(API),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
export const buildViewV2Endpoints = API => ({
|
||||
/**
|
||||
* Fetches all rows in a view
|
||||
* @param id the id of the view
|
||||
*/
|
||||
get: async id => {
|
||||
return await API.get({ url: `/api/v2/views/${id}` })
|
||||
},
|
||||
/**
|
||||
* Get a view information
|
||||
* @param id the id of the view
|
||||
*/
|
||||
fetch: async id => {
|
||||
return await API.get({ url: `/api/v2/views/${id}/search` })
|
||||
},
|
||||
})
|
Loading…
Reference in New Issue