fixing tests

This commit is contained in:
Martin McKeaveney 2020-04-06 14:28:22 +01:00
parent 5774f99fee
commit 1f000e2be1
3 changed files with 14 additions and 19 deletions

View File

@ -1,7 +0,0 @@
{
"name": "newscreen",
"props": {
"_component": "@budibase/standard-component/div",
"className": "something else"
}
}

View File

@ -15,7 +15,7 @@ const {
authenticatedRoutes authenticatedRoutes
} = require("./routes"); } = require("./routes");
const builderPath = resolve(__dirname, "../../builder") const builderPath = resolve(__dirname, "../builder")
module.exports = (config, app) => { module.exports = (config, app) => {
const router = new Router() const router = new Router()

View File

@ -3,12 +3,24 @@ const StatusCodes = require("../../utilities/statusCodes")
const { const {
listScreens, listScreens,
saveScreen, saveScreen,
buildPage buildPage,
renameScreen,
deleteScreen
} = require("../../utilities/builder") } = require("../../utilities/builder")
const router = Router() const router = Router()
router.post("/_builder/api/:appname/pages/:pageName", async ctx => {
await buildPage(
ctx.config,
ctx.params.appname,
ctx.params.pageName,
ctx.request.body
)
ctx.response.status = StatusCodes.OK
})
router.get("/_builder/api/:appname/pages/:pagename/screens", async ctx => { router.get("/_builder/api/:appname/pages/:pagename/screens", async ctx => {
ctx.body = await listScreens( ctx.body = await listScreens(
ctx.config, ctx.config,
@ -58,14 +70,4 @@ router
ctx.response.status = StatusCodes.OK ctx.response.status = StatusCodes.OK
}) })
router.post("/_builder/api/:appname/pages/:pageName", async ctx => {
await buildPage(
ctx.config,
ctx.params.appname,
ctx.params.pageName,
ctx.request.body
)
ctx.response.status = StatusCodes.OK
})
module.exports = router module.exports = router