diff --git a/frontend/src/components/Forms/OptionalProgramsForm.vue b/frontend/src/components/Forms/OptionalProgramsForm.vue index ec409fbc..b2e6daa5 100644 --- a/frontend/src/components/Forms/OptionalProgramsForm.vue +++ b/frontend/src/components/Forms/OptionalProgramsForm.vue @@ -11,7 +11,7 @@ - + @@ -133,12 +127,12 @@ export default { } }, watch: { - // selectedOptionalProgram(newVal) { - // // The function to be executed when isCareerProgram changes - // if (!this.isCareerProgram(newVal)) { - // this.clearCareerPrograms(); - // } - // }, + optionalProgramChange: function (newVal) { + // The function to be executed when isCareerProgram changes + if (!this.isCareerProgram(newVal)) { + this.clearCareerPrograms(); + } + }, }, mounted() { this.fetchPrograms(); @@ -163,10 +157,10 @@ export default { allowOptionalProgramUpdate: "allowOptionalProgramUpdate", }), optionalProgramChange() { - return this.selectedOptionalProgram; + return this.form.selectedOptionalProgram; }, careerProgramChange() { - return this.selectedCareerProgram; + return this.form.selectedCareerProgram; }, activeOptionalPrograms() { const studentProgramId = this.studentGradStatus.program; @@ -235,7 +229,11 @@ export default { return activeProgram && activeProgram.optProgramCode === "CP"; }, clearCareerPrograms() { - this.selectedCareerPrograms = []; + console.log('clear career programs') + this.form.selectedCareerPrograms = null; + }, + clearOptionalProgram() { + this.form.selectedOptionalProgram = null; }, optionalProgramTitle(item) { if (item) { @@ -283,13 +281,13 @@ export default { }, clearForm() { console.log("form cleared"); - this.selectedOptionalProgram = ""; - this.selectedCareerPrograms = ""; + this.clearOptionalProgram() + this.clearCareerPrograms() }, submitForm() { this.addStudentOptionalProgram( - this.selectedOptionalProgram, - this.selectedCareerPrograms + this.form.selectedOptionalProgram, + this.form.selectedCareerPrograms ); this.closeCreateOptionalProgramDialog(); }, diff --git a/frontend/src/components/StudentProfile/StudentOptionalPrograms.vue b/frontend/src/components/StudentProfile/StudentOptionalPrograms.vue index 47765eb7..e0e1f7e2 100644 --- a/frontend/src/components/StudentProfile/StudentOptionalPrograms.vue +++ b/frontend/src/components/StudentProfile/StudentOptionalPrograms.vue @@ -28,8 +28,6 @@