converted settings, note revisions, password change and recent changes routes

This commit is contained in:
azivner
2018-03-30 13:56:46 -04:00
parent 8550ed72f2
commit 9edee9340b
8 changed files with 61 additions and 92 deletions

View File

@@ -1,12 +1,8 @@
"use strict";
const express = require('express');
const router = express.Router();
const sql = require('../../services/sql');
const auth = require('../../services/auth');
const wrap = require('express-promise-wrap').wrap;
router.get('/', auth.checkApiAuth, wrap(async (req, res, next) => {
async function getRecentChanges() {
const recentChanges = await sql.getRows(
`SELECT
notes.isDeleted AS current_isDeleted,
@@ -19,7 +15,9 @@ router.get('/', auth.checkApiAuth, wrap(async (req, res, next) => {
dateModifiedTo DESC
LIMIT 1000`);
res.send(recentChanges);
}));
return recentChanges;
}
module.exports = router;
module.exports = {
getRecentChanges
};