Mm...y no es mejor que te las esconda la query para no estar mandando información extra?


Arturo Tagle

On 23-01-2014, at 22:36, "Pedro" <notifications@github.com> wrote:

> In routes/api/campaign.js:
> 
> > @@ -5,12 +5,22 @@ exports.get = function (req, res) {
> >    var param = (JSON.stringify(req.query) === JSON.stringify({}) ? req.body : req.query);
> >    var campaignMongoose;
> >    if (param.campaign && !req.user.isSuperAdmin) {
> > -    campaignMongoose = model.Campaign.find({_id: param.campaign, company: req.user.company._id});
> > -  } else if (param.campaign && req.user.isSuperAdmin) {
> > +    campaignMongoose = model.Campaign.find({
> > +      _id: param.campaign,
> > +      company: req.user.company._id,
> > +      'status.isDelete' : false
> Ah si, estaba hecho así, siempre te manda todas las campañas, la idea es que por frontend las escondas
> 
> —
> Reply to this email directly or view it on GitHub.