Skip to content

Commit 55ead33

Browse files
committed
Fix duplicate responses
1 parent 351934a commit 55ead33

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

plugins/compliance-hub/api/api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ const FEATURE_NAME = 'compliance_hub';
129129
case 'current': {
130130
if (!params.qstring.app_id) {
131131
common.returnMessage(params, 400, 'Missing parameter "app_id"');
132-
return false;
132+
return true;
133133
}
134134
validateRead(params, FEATURE_NAME, function() {
135135
var query = params.qstring.query || {};
@@ -150,7 +150,7 @@ const FEATURE_NAME = 'compliance_hub';
150150
case 'search': {
151151
if (!params.qstring.app_id) {
152152
common.returnMessage(params, 400, 'Missing parameter "app_id"');
153-
return false;
153+
return true;
154154
}
155155
validateRead(params, FEATURE_NAME, function() {
156156
var query = params.qstring.query || {};
@@ -271,7 +271,7 @@ const FEATURE_NAME = 'compliance_hub';
271271
case 'consents': {
272272
if (!params.qstring.app_id) {
273273
common.returnMessage(params, 400, 'Missing parameter "app_id"');
274-
return false;
274+
return true;
275275
}
276276
validateRead(params, FEATURE_NAME, function() {
277277
appUsers.count(params.qstring.app_id, {}, function(err, total) {

plugins/errorlogs/tests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ describe('Testing Error Logs Plugin', function() {
219219
if (err2) {
220220
return done(err2);
221221
}
222+
console.log(res2.text);
222223
var logContent = JSON.parse(res2.text);
223224
logContent.should.be.an.instanceOf(Object);
224225
// After clearing, log should be empty or contain minimal content

plugins/populator/api/api.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const FEATURE_NAME = 'populator';
6161

6262
if (!validatedArgs.result) {
6363
common.returnMessage(obParams, 400, "Invalid params: " + validatedArgs.errors.join());
64-
return false;
64+
return true;
6565
}
6666
const template = validatedArgs.obj;
6767
if (template.behavior && template.behavior.sequences && !template.behavior.sequences.length) {
@@ -70,7 +70,7 @@ const FEATURE_NAME = 'populator';
7070
}
7171
catch (e) {
7272
common.returnMessage(obParams, 400, "Invalid type for behavior!");
73-
return false;
73+
return true;
7474
}
7575
}
7676

@@ -641,15 +641,15 @@ const FEATURE_NAME = 'populator';
641641
const obParams = ob.params;
642642
if (!obParams.qstring.environment_id) {
643643
common.returnMessage(obParams, 401, "Missing parameter environment_id");
644-
return false;
644+
return true;
645645
}
646646
if (!obParams.qstring.template_id) {
647647
common.returnMessage(obParams, 401, "Missing parameter template_id");
648-
return false;
648+
return true;
649649
}
650650
if (!obParams.qstring.app_id) {
651651
common.returnMessage(obParams, 401, "Missing parameter app_id");
652-
return false;
652+
return true;
653653
}
654654
validateRead(obParams, FEATURE_NAME, function() {
655655
let startPos = 0;
@@ -717,11 +717,11 @@ const FEATURE_NAME = 'populator';
717717
const obParams = ob.params;
718718
if (!obParams.qstring.environment_id) {
719719
common.returnMessage(obParams, 401, "Missing parameter environment_id");
720-
return false;
720+
return true;
721721
}
722722
if (!obParams.qstring.template_id) {
723723
common.returnMessage(obParams, 401, "Missing parameter template_id");
724-
return false;
724+
return true;
725725
}
726726
validateDelete(obParams, FEATURE_NAME, function() {
727727
common.db.collection('populator_environment_users').deleteMany({

0 commit comments

Comments
 (0)