2020-05-07 11:53:34 +02:00
|
|
|
const Router = require("@koa/router")
|
|
|
|
const controller = require("../controllers/screen")
|
2020-05-21 15:31:23 +02:00
|
|
|
const authorized = require("../../middleware/authorized")
|
|
|
|
const { BUILDER } = require("../../utilities/accessLevels")
|
2020-04-29 21:29:42 +02:00
|
|
|
|
2020-05-07 11:53:34 +02:00
|
|
|
const router = Router()
|
2020-04-29 21:29:42 +02:00
|
|
|
|
|
|
|
router
|
2020-05-21 15:31:23 +02:00
|
|
|
.get("/api/:instanceId/screens", authorized(BUILDER), controller.fetch)
|
|
|
|
.post("/api/:instanceId/screens", authorized(BUILDER), controller.save)
|
|
|
|
.delete(
|
|
|
|
"/api/:instanceId/:screenId/:revId",
|
|
|
|
authorized(BUILDER),
|
|
|
|
controller.destroy
|
|
|
|
)
|
2020-04-29 21:29:42 +02:00
|
|
|
|
2020-05-07 11:53:34 +02:00
|
|
|
module.exports = router
|