Skip to content

Commit

Permalink
Certify Controller & add/Remove Instructor fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaMicallefYBSU committed Aug 23, 2024
1 parent ecb55b5 commit 9f9eee0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/Http/Controllers/Training/InstructingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public function certifyStudent($cid)
}

// Unassign Instructor from Student
$instructor_link = InstructorStudentAssignment::where('student_id', $cid);
$instructor_link = InstructorStudentAssignment::where('student_id', $student->id);
$instructor_link->delete();

// Create new certification (for home page)
Expand Down Expand Up @@ -613,7 +613,7 @@ public function assignStudentToInstructor(Request $request, $student_id)
$link->save();

// Update Thread Tag
if ($student->user->hasDiscord() && $student->user->member_of_czqo) {
if ($student->user->member_of_czqo) {
$discord = new DiscordClient();
$discord->EditThreadTag('In Progress', $student->user->id);
}
Expand Down Expand Up @@ -642,6 +642,12 @@ public function dropStudentFromInstructor($student_id)
$label->delete();
}

// Update Thread Tag
if ($student->user->member_of_czqo) {
$discord = new DiscordClient();
$discord->EditThreadTag('Ready For Pick-Up', $student->user->id);
}

//Assign it with link
$link = new StudentStatusLabelLink([
'student_id' => $student->id,
Expand Down

0 comments on commit 9f9eee0

Please sign in to comment.