final checkin before version bump
This commit is contained in:
parent
f3e1f79915
commit
dcc8917a6d
BIN
app/.DS_Store
vendored
Normal file
BIN
app/.DS_Store
vendored
Normal file
Binary file not shown.
@ -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(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) {
|
||||
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) {
|
||||
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');
|
||||
busEmitter.emit('getBookmarkRes', req.query.url, res);
|
||||
|
||||
});
|
||||
|
||||
router.post('/new', function(req, res) {
|
||||
}).post(function(req, res, next) {
|
||||
logger.debug('Posted Save new');
|
||||
logger.info(req.body);
|
||||
if (Object.keys(req.body).length !== 0) {
|
||||
@ -777,7 +777,6 @@ router.post('/new', function(req, res) {
|
||||
} else {
|
||||
res.status(422).end();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
busEmitter.emit('updateTagsDB');
|
||||
|
1
server/output.json
Normal file
1
server/output.json
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user