UNCLASSIFIED

Commit 61deaaa7 authored by Keith Becker's avatar Keith Becker
Browse files

Refactor

parent 342c3e0a
...@@ -58,6 +58,7 @@ import { setInputElementFocus } from "@/utils/events"; ...@@ -58,6 +58,7 @@ import { setInputElementFocus } from "@/utils/events";
import { SET_ERROR_MESSAGE, SET_ERROR_DIALOG } from "@/store/mutation-types"; import { SET_ERROR_MESSAGE, SET_ERROR_DIALOG } from "@/store/mutation-types";
import CourseService from "@/api/services/training"; import CourseService from "@/api/services/training";
import UserSelectForCourse from "@/components/Dialogs/DialogComponents/UserSelectForCourse"; import UserSelectForCourse from "@/components/Dialogs/DialogComponents/UserSelectForCourse";
import { availableSeatsInCourse } from "@/utils/course";
export default { export default {
name: "SelectAddStudentsToCourseDialog", name: "SelectAddStudentsToCourseDialog",
...@@ -139,17 +140,7 @@ export default { ...@@ -139,17 +140,7 @@ export default {
areNoAvailableSeats() { areNoAvailableSeats() {
return this.availableSeatsInCourse < 0; return this.availableSeatsInCourse < 0;
}, },
availableSeatsInCourse() { availableSeatsInCourse,
let seats = this.course.capacity;
if (isNaN(seats)) {
seats = 10;
}
if (!isNaN(this.courseMembers.length)) {
seats -= this.courseMembers.length;
}
seats -= this.courseRegistrations.length;
return seats;
},
canSubmit() { canSubmit() {
return ( return (
this.isCourseSelected && this.isCourseSelected &&
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment