I get the feeling that this function can be shortened, but I'm not sure what would be the best way to do it. I would like to make the following function more efficient. Your help will be greatly appreciated.
My Function
onStudentActionSelect: function () {
if (this.selectedRows.length === 1) {
this.$store.commit(SET_MODAL_OPTIONS, {
modalContent: MODAL_CONTENT.DELETE_STUDENT(this.selectedRows[0].name),
modalSettings: MODAL_SETTINGS.CANCEL_DELETE,
modalCallback: this.deleteStudent
})
} else if (this.selectedRows.length > 1) {
this.$store.commit(SET_MODAL_OPTIONS, {
modalContent: MODAL_CONTENT.DELETE_STUDENTS(this.selectedRows.length),
modalSettings: MODAL_SETTINGS.CANCEL_DELETE,
modalCallback: this.deleteStudents
})
}
}