final checkin before version bump

This commit is contained in:
Martin Donnelly 2016-07-26 10:51:25 +01:00
parent f3e1f79915
commit dcc8917a6d
4 changed files with 46 additions and 46 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

BIN
app/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -632,7 +632,9 @@ router.get('/entry/:id', function(req, res) {
}); });
}); });
router.get('/tags', function(req, res) {
router.route('/tags')
.get(function(req, res, next) {
logger.debug('tag list..'); logger.debug('tag list..');
logger.debug(req.params.id); logger.debug(req.params.id);
@ -659,8 +661,47 @@ router.get('/tags', function(req, res) {
} }
}); });
}).post(function(req, res, next) {
var t = req.body;
console.log(t);
logger.info('regetting:' + req.body._id);
dbCouch.get(req.body._id, function(err, body) {
if (!err) {
var obj = {};
obj.url = body.url;
obj.html = body.html;
obj.reduced = body.reduced;
obj.title = body.title;
obj.tags = req.body.tags;
logger.info('Updating...');
busEmitter.emit('updateBookmarkData', obj, body._id, body._rev, res);
var outJSON = {};
outJSON._id = body._id;
outJSON._rev = body._rev;
outJSON.title = body.title;
outJSON.reduced = body.reduced;
outJSON.url = body.url;
outJSON.tags = req.body.tags;
//Logger.debug(util.inspect(body));
res.writeHead(200, {ContentType: 'application/json'});
res.end(JSON.stringify(outJSON));
} else {
res.writeHead(500, {ContentType: 'application/json'});
res.end(JSON.stringify({}));
}
});
}); });
router.get('/tags/:id', function(req, res) { router.get('/tags/:id', function(req, res) {
logger.debug('entry..'); logger.debug('entry..');
@ -706,45 +747,6 @@ router.post('/add', function(req, res) {
}); });
router.post('/tags', function(req, res) {
var t = req.body;
console.log(t);
logger.info('regetting:' + req.body._id);
dbCouch.get(req.body._id, function(err, body) {
if (!err) {
var obj = {};
obj.url = body.url;
obj.html = body.html;
obj.reduced = body.reduced;
obj.title = body.title;
obj.tags = req.body.tags;
logger.info('Updating...');
busEmitter.emit('updateBookmarkData', obj, body._id, body._rev, res);
var outJSON = {};
outJSON._id = body._id;
outJSON._rev = body._rev;
outJSON.title = body.title;
outJSON.reduced = body.reduced;
outJSON.url = body.url;
outJSON.tags = req.body.tags;
//Logger.debug(util.inspect(body));
res.writeHead(200, {ContentType: 'application/json'});
res.end(JSON.stringify(outJSON));
} else {
res.writeHead(500, {ContentType: 'application/json'});
res.end(JSON.stringify({}));
}
});
});
router.post('/redo', function(req, res) { router.post('/redo', function(req, res) {
logger.debug('redoing entry..'); logger.debug('redoing entry..');
@ -763,13 +765,11 @@ router.post('/redo', function(req, res) {
}); });
router.get('/new', function(req, res) { router.route('/new')
.get(function(req, res, next) {
logger.debug('Save new'); logger.debug('Save new');
busEmitter.emit('getBookmarkRes', req.query.url, res); busEmitter.emit('getBookmarkRes', req.query.url, res);
}).post(function(req, res, next) {
});
router.post('/new', function(req, res) {
logger.debug('Posted Save new'); logger.debug('Posted Save new');
logger.info(req.body); logger.info(req.body);
if (Object.keys(req.body).length !== 0) { if (Object.keys(req.body).length !== 0) {
@ -777,7 +777,6 @@ router.post('/new', function(req, res) {
} else { } else {
res.status(422).end(); res.status(422).end();
} }
}); });
busEmitter.emit('updateTagsDB'); busEmitter.emit('updateTagsDB');

1
server/output.json Normal file

File diff suppressed because one or more lines are too long