diff --git a/peer-prep-fe/src/edit-page/edit-page.component.ts b/peer-prep-fe/src/edit-page/edit-page.component.ts index 6d21a9a420..5a1d544eed 100644 --- a/peer-prep-fe/src/edit-page/edit-page.component.ts +++ b/peer-prep-fe/src/edit-page/edit-page.component.ts @@ -94,6 +94,12 @@ export class EditPageComponent implements OnInit { } saveQuestion() { + const selectedCategories = this.question_categories.filter(cat => cat.selected); + if (selectedCategories.length === 0) { + alert("Please select at least one category."); + return; + } + const updatedQuestion = { question_title: this.question_title, question_description: this.question_description,