Skip to content

Commit

Permalink
Fixed collector retrieval in webhook controller
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeStatik committed Nov 17, 2022
1 parent 91e849c commit 806bfcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Http/Controllers/Api/SurveyheroWebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function handleResponseCompletedWebhook(SurveyResponseImportService $surv
}

//Check if response is from a configured collector, if not configured we do not import the response.
$collectors = $questionMapping[0]['collectors'];
$collectors = collect($questionMapping)->where('survey_id', $responseData['survey_id'])->pluck('collectors')->first();
Log::info($collectors);
if ($collectors && count($collectors) > 0 && ! in_array($responseData['collector_id'], $collectors)) {
return response()->json([
Expand Down

0 comments on commit 806bfcf

Please sign in to comment.