budibase/packages/server/middleware/controllers/database.js

12 lines
287 B
JavaScript
Raw Normal View History

2020-04-07 16:12:08 +02:00
const couchdb = require("../../db");
const controller = {
create: async ctx => {
ctx.body = await couchdb.db.create(ctx.request.body.databaseName);
},
destroy: async ctx => {
2020-04-07 18:25:09 +02:00
ctx.body = await couchdb.db.destroy(ctx.params.databaseName)
2020-04-07 16:12:08 +02:00
}
}
module.exports = controller;