Add controller scaffolding for views v2
This commit is contained in:
parent
7dbf71d477
commit
6ff5c23cd6
|
@ -1 +1,2 @@
|
||||||
export * as v1 from "./legacyViews"
|
export * as v1 from "./legacyViews"
|
||||||
|
export * as v2 from "./views"
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import sdk from "../../../sdk"
|
||||||
|
import { Ctx } from "@budibase/types"
|
||||||
|
|
||||||
|
export async function fetch(ctx: Ctx) {
|
||||||
|
ctx.body = await sdk.views.get()
|
||||||
|
}
|
|
@ -8,6 +8,11 @@ import { permissions } from "@budibase/backend-core"
|
||||||
const router: Router = new Router()
|
const router: Router = new Router()
|
||||||
|
|
||||||
router
|
router
|
||||||
|
.get(
|
||||||
|
"/api/views/v2",
|
||||||
|
authorized(permissions.BUILDER),
|
||||||
|
viewController.v2.fetch
|
||||||
|
)
|
||||||
.get(
|
.get(
|
||||||
"/api/views/export",
|
"/api/views/export",
|
||||||
authorized(permissions.BUILDER),
|
authorized(permissions.BUILDER),
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { default as queries } from "./app/queries"
|
||||||
import { default as rows } from "./app/rows"
|
import { default as rows } from "./app/rows"
|
||||||
import { default as users } from "./users"
|
import { default as users } from "./users"
|
||||||
import { default as plugins } from "./plugins"
|
import { default as plugins } from "./plugins"
|
||||||
|
import * as views from "./views"
|
||||||
|
|
||||||
const sdk = {
|
const sdk = {
|
||||||
backups,
|
backups,
|
||||||
|
@ -18,6 +19,7 @@ const sdk = {
|
||||||
datasources,
|
datasources,
|
||||||
queries,
|
queries,
|
||||||
plugins,
|
plugins,
|
||||||
|
views,
|
||||||
}
|
}
|
||||||
|
|
||||||
// default export for TS
|
// default export for TS
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
export async function get() {
|
||||||
|
return []
|
||||||
|
}
|
Loading…
Reference in New Issue