|
|
|
@ -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); |
|
|
|
|
} |
|
|
|
|