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

18 lines
368 B
JavaScript
Raw Normal View History

2020-04-07 16:12:08 +02:00
const couchdb = require("../../db");
const controller = {
save: async ctx => {
},
fetch: async ctx => {
const databaseId = ctx.params.databaseId;
const instance = couchdb.db.use(databaseId)
const documents = await instance.list({});
ctx.status = 200;
ctx.body = documents;
},
destroy: async ctx => {
},
}
module.exports = controller;