Skip to content

Commit

Permalink
fix(*): fix the logic only those category will be shown in the catego…
Browse files Browse the repository at this point in the history
…ry dropdown which is present in the data
  • Loading branch information
Ayush8923 committed Aug 29, 2024
1 parent 56e8d0c commit f492e09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fill_survey/survey_insights.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
];

$defaultCategory = reset($surveyinsightsdata->categoriesScores);
$categorySlugs = [];
foreach ($surveyinsightsdata->categoriesScores as $categoriesscore) {
$table->data[] = [
$categoriesscore->catgororySlug,
$categoriesscore->score,
];
$categorySlugs[] = $categoriesscore->catgororySlug;
}

$interpretationsData = [];
Expand All @@ -51,7 +53,9 @@

$statusoptions = [];
foreach ($questioncategories as $questioncategorie) {
$statusoptions[$questioncategorie->slug] = $questioncategorie->label;
if(in_array($questioncategorie->label, $categorySlugs)) {
$statusoptions[$questioncategorie->slug] = $questioncategorie->label;
}
}
?>

Expand Down

0 comments on commit f492e09

Please sign in to comment.