Skip to content

Commit

Permalink
Check for category
Browse files Browse the repository at this point in the history
  • Loading branch information
AidenLYT committed Nov 13, 2024
1 parent 860cde4 commit 3f18483
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions peer-prep-fe/src/edit-page/edit-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3f18483

Please sign in to comment.