UNCLASSIFIED

Commit 5acac03e authored by hunter.congress's avatar hunter.congress
Browse files

fix api

parent 419f0100
...@@ -9653,15 +9653,6 @@ ...@@ -9653,15 +9653,6 @@
"reusify": "^1.0.4" "reusify": "^1.0.4"
} }
}, },
"faye-websocket": {
"version": "0.11.4",
"resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz",
"integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==",
"dev": true,
"requires": {
"websocket-driver": ">=0.5.1"
}
},
"fb-watchman": { "fb-watchman": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz",
...@@ -21628,9 +21619,6 @@ ...@@ -21628,9 +21619,6 @@
"version": "5.1.2", "version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"requires": {
"is-glob": "^4.0.1"
},
"dependencies": { "dependencies": {
"is-glob": { "is-glob": {
"version": "3.1.0", "version": "3.1.0",
...@@ -21739,6 +21727,17 @@ ...@@ -21739,6 +21727,17 @@
"faye-websocket": "^0.11.3", "faye-websocket": "^0.11.3",
"uuid": "^3.4.0", "uuid": "^3.4.0",
"websocket-driver": "^0.7.4" "websocket-driver": "^0.7.4"
},
"dependencies": {
"faye-websocket": {
"version": "0.11.4",
"resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz",
"integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==",
"dev": true,
"requires": {
"websocket-driver": ">=0.5.1"
}
}
} }
}, },
"strip-ansi": { "strip-ansi": {
......
...@@ -52,16 +52,16 @@ export default { ...@@ -52,16 +52,16 @@ export default {
return HTTP.put(`/courses/${courseId}`, { ...course, selectedInstructors }); return HTTP.put(`/courses/${courseId}`, { ...course, selectedInstructors });
}, },
async addStudent(courseId, student) { async addStudent(courseId, student) {
return HTTP.post(`/courses/${courseId}/registrations`, student); return HTTP.post(`/courses/${courseId}/pending-registrations`, student);
}, },
async addStudents(courseId, students) { async addStudents(courseId, students, pmId) {
for (const student of students) { for (const student of students) {
await this.addStudent(courseId, { userId: student.id }); await this.addStudent(courseId, { userId: student.id, pmId: pmId });
} }
}, },
async addStudentsToCourses(courses, students) { async addStudentsToCourses(courses, students, pmId) {
for (const { id: courseId } of courses) { for (const { id: courseId } of courses) {
await this.addStudents(courseId, students); await this.addStudents(courseId, students, pmId);
} }
}, },
async exportCourses() { async exportCourses() {
......
...@@ -70,7 +70,11 @@ export default { ...@@ -70,7 +70,11 @@ export default {
async addSelectedUsersToSelectedCourses() { async addSelectedUsersToSelectedCourses() {
this.isAddingBusy = true; this.isAddingBusy = true;
try { try {
await CourseService.addStudents(this.courseId, this.courseMembers); await CourseService.addStudents(
this.courseId,
this.courseMembers,
this.$store.state.user.user.id
);
this.$emit("update-students"); this.$emit("update-students");
} catch (error) { } catch (error) {
console.error("!add courses error!", error); console.error("!add courses error!", error);
...@@ -90,6 +94,7 @@ export default { ...@@ -90,6 +94,7 @@ export default {
}, },
cancel() { cancel() {
this.$emit("close-dialog"); this.$emit("close-dialog");
console.log(this.$store.state.user.user.id);
}, },
}, },
data() { data() {
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
v-bind:courseId="currentCourseId" v-bind:courseId="currentCourseId"
v-bind:id="item.user.id" v-bind:id="item.user.id"
v-bind:pm="item.pm.id" v-bind:pm="item.pm.id"
v-bind:mainMessage="`Your request to add a team member into ${$props.trainingCourse.name} - ${$props.trainingCourse.startDate}-${$props.trainingCourse.endDate} has been denied due to the following reasons:`" v-bind:mainMessage="`Your request to add a team member into $props.trainingCourse.name - $props.trainingCourse.startDate - $props.trainingCourse.endDate has been denied due to the following reasons:`"
class="mx-2" class="mx-2"
@change="fetchReload" @change="fetchReload"
/> />
...@@ -82,7 +82,7 @@ import { ...@@ -82,7 +82,7 @@ import {
DEFAULT_TABLE_OPTIONS, DEFAULT_TABLE_OPTIONS,
} from "@/config/table-constants"; } from "@/config/table-constants";
export default { export default {
name: "TrainingAttendance", name: "PendingRequests",
components: { DenialNotification }, components: { DenialNotification },
props: { props: {
trainingCourse: { trainingCourse: {
...@@ -180,7 +180,7 @@ export default { ...@@ -180,7 +180,7 @@ export default {
this.total = response.meta?.total || 0; this.total = response.meta?.total || 0;
} catch (error) { } catch (error) {
const errorMessage = error; const errorMessage = error;
console.log("ERROR"); console.error("ERROR");
this.$store.commit(SET_ERROR_MESSAGE, errorMessage); this.$store.commit(SET_ERROR_MESSAGE, errorMessage);
this.$store.commit(SET_ERROR_DIALOG, true); this.$store.commit(SET_ERROR_DIALOG, true);
} }
......
...@@ -370,7 +370,7 @@ ...@@ -370,7 +370,7 @@
</v-btn> </v-btn>
</div> </div>
<PendingRequests <PendingRequests
ref="trainingAttendance" ref="pendingRequests"
class="px-0" class="px-0"
v-if="trainingCourse.id" v-if="trainingCourse.id"
:trainingCourse="trainingCourse" :trainingCourse="trainingCourse"
...@@ -518,7 +518,6 @@ export default { ...@@ -518,7 +518,6 @@ export default {
methods: { methods: {
fetchReload(value) { fetchReload(value) {
if (value) { if (value) {
console.log("reload");
this.trigger += 1; this.trigger += 1;
} }
}, },
...@@ -594,6 +593,7 @@ export default { ...@@ -594,6 +593,7 @@ export default {
// delay new call // delay new call
this.fetchData(); this.fetchData();
this.$refs.trainingAttendance.fetchDebounced(); this.$refs.trainingAttendance.fetchDebounced();
this.$refs.pendingRequests.fetchDebounced();
this.$refs.addStudentsToCourseDialog.fetchDebounced(); this.$refs.addStudentsToCourseDialog.fetchDebounced();
}, },
async updateCourse() { async updateCourse() {
......
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