Fixed a bug where projection in /db/campaign/.../levels wasn't working correctly anymore if project wasn't included.

This commit is contained in:
Scott Erickson 2015-01-06 16:59:56 -08:00
parent 1c1f2be497
commit 7f203f246c

View file

@ -39,7 +39,7 @@ CampaignHandler = class CampaignHandler extends Handler
getRelatedLevels: (req, res, campaign, projection) ->
extraProjectionProps = []
if projection
unless _.isEmpty(projection)
# Make sure that permissions and version are fetched, but not sent back if they didn't ask for them.
extraProjectionProps.push 'permissions' unless projection.permissions
extraProjectionProps.push 'version' unless projection.version