mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-14 07:52:15 +00:00
feat(coupons): better formatting for wondercon
This commit is contained in:
parent
39b5176c1c
commit
8d4652b6b9
1 changed files with 3 additions and 3 deletions
|
|
@ -18,13 +18,13 @@ api.generateCoupons = function(req,res,next) {
|
|||
}
|
||||
|
||||
api.getCoupons = function(req,res,next) {
|
||||
var options = {sort:'-seq'};
|
||||
var options = {sort:'seq'};
|
||||
if (req.query.limit) options.limit = req.query.limit;
|
||||
if (req.query.skip) options.limit = req.query.skip;
|
||||
Coupon.find({},{}, options, function(err,coupons){
|
||||
//res.header('Content-disposition', 'attachment; filename=coupons.csv');
|
||||
res.csv([['seq','event','code']].concat(_.map(coupons, function(c){
|
||||
return [c.seq, c.event, c._id];
|
||||
res.csv([['code']].concat(_.map(coupons, function(c){
|
||||
return ['HabitRPG - To redeem your code, go to goo.gl/azsGaH and enter '+c._id];
|
||||
})));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue