Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
735 B

const Router = require("@koa/router")
const tableController = require("../controllers/table")
const authorized = require("../../middleware/authorized")
const { BUILDER, READ_TABLE } = require("../../utilities/accessLevels")
const router = Router()
router
.get("/api/tables", authorized(BUILDER), tableController.fetch)
.get(
"/api/tables/:id",
authorized(READ_TABLE, ctx => ctx.params.id),
tableController.find
)
.post("/api/tables", authorized(BUILDER), tableController.save)
.post(
"/api/tables/csv/validate",
authorized(BUILDER),
tableController.validateCSVSchema
)
.delete(
"/api/tables/:tableId/:revId",
authorized(BUILDER),
tableController.destroy
)
module.exports = router