renaming of sql methods to fit getRows/getEntities model

This commit is contained in:
azivner
2018-01-29 17:41:59 -05:00
parent 9b53a17168
commit b44412bc32
32 changed files with 134 additions and 123 deletions

View File

@@ -19,7 +19,7 @@ const RESOURCE_DIR = require('../../services/resource_dir').RESOURCE_DIR;
const fs = require('fs');
router.get('/:imageId/:filename', auth.checkApiAuthOrElectron, wrap(async (req, res, next) => {
const image = await sql.getFirst("SELECT * FROM images WHERE imageId = ?", [req.params.imageId]);
const image = await sql.getRow("SELECT * FROM images WHERE imageId = ?", [req.params.imageId]);
if (!image) {
return res.status(404).send({});
@@ -39,7 +39,7 @@ router.post('', auth.checkApiAuthOrElectron, multer.single('upload'), wrap(async
const noteId = req.query.noteId;
const file = req.file;
const note = await sql.getFirst("SELECT * FROM notes WHERE noteId = ?", [noteId]);
const note = await sql.getRow("SELECT * FROM notes WHERE noteId = ?", [noteId]);
if (!note) {
return res.status(404).send(`Note ${noteId} doesn't exist.`);