rutilus-analytics-node-js
Version:
Provides a GUI web app that allows users to examine their data in detail. Includes CSV export functionality.
34 lines (26 loc) • 576 B
JavaScript
/**
* Rutilus
*
* @homepage https://gmrutilus.github.io
* @license Apache-2.0
*/
/**
* Contains the route used fetch all accounts
*/
/** @module */
module.exports = /** @param {KoaCtx} ctx */ async (ctx) => {
const {
errorHandler,
schemas,
} = ctx.res;
await new Promise((resolve) => {
schemas.Accounts.find({}, (err, docs) => {
if (err) {
ctx.body = errorHandler.dbErrorCatcher(err);
return;
}
ctx.body = docs;
resolve();
});
});
};