diff --git a/plugins/star-rating/api/api.js b/plugins/star-rating/api/api.js index 4bf19ef7524..619eed4bc30 100644 --- a/plugins/star-rating/api/api.js +++ b/plugins/star-rating/api/api.js @@ -722,9 +722,15 @@ function uploadFile(myfile, id, callback) { if (!changes.targeting) { changes.targeting = {}; } + if (!changes.targeting.user_segmentation) { + changes.targeting.user_segmentation = '{"query":{},"queryText":""}'; + } + if (!changes.targeting.steps) { + changes.targeting.steps = '[]'; + } changes.targeting.app_id = params.app_id + "";//has to be string // eslint-disable-next-line - createCohort(params, type, widgetId, changes.targeting, function(cohortId) { //create cohort using this + createCohort(params, type, widgetId, changes.targeting, function(cohortId) { //create cohort using this if (cohortId) { //update widget record to have this cohortId common.db.collection("feedback_widgets").findAndModify({ "_id": widgetId }, {}, { $set: { "cohortID": cohortId } }, function(/*err, widget*/) {