Browse Source

Update TagController

master
sipp11 9 years ago
parent
commit
18596a052e
  1. 6
      api/controllers/TagController.js

6
api/controllers/TagController.js

@ -25,13 +25,15 @@ module.exports = {
}
page = ((req.query.page != undefined) ? +req.query.page : 1);
Tag.find(q).paginate({page: page, limit: 10}).exec(function(err, items) {
// TODO: find a way to rank it, so it's easier to tag
Tag.find(q).paginate({page: page, limit: 20}).exec(function(err, items) {
if (format == 'long') {
res.send(items);
} else {
var tags = [];
for (var ind in items) {
tags.push(items[ind].name);
var text = items[ind].name;
tags.push({id: text, name: text});
}
res.send(tags);
}

Loading…
Cancel
Save