From 042ee01b8461c605d48f99177d9291b049a7f67c Mon Sep 17 00:00:00 2001 From: gemj98 Date: Mon, 6 May 2024 15:48:45 -0700 Subject: [PATCH] Update CourseFragment.kt --- .../studentportal/course/ui/fragment/CourseFragment.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/front_end/app/src/main/java/com/example/studentportal/course/ui/fragment/CourseFragment.kt b/front_end/app/src/main/java/com/example/studentportal/course/ui/fragment/CourseFragment.kt index 93de273f..e8c3d456 100644 --- a/front_end/app/src/main/java/com/example/studentportal/course/ui/fragment/CourseFragment.kt +++ b/front_end/app/src/main/java/com/example/studentportal/course/ui/fragment/CourseFragment.kt @@ -43,6 +43,11 @@ class CourseFragment( return requireArguments().getParcelable(KEY_COURSE) } + private val userId: String + get() { + return requireArguments().getString(KEY_USER_ID) ?: "" + } + override fun inflateBinding( inflater: LayoutInflater, container: ViewGroup? @@ -59,7 +64,8 @@ class CourseFragment( Command.ShowAssignments -> { val fragment = AssignmentsFragment.newInstance( course?.id.orEmpty(), - userType.name + userId = userId, + userType = userType.name ) parentFragmentManager.showBaseFragment( fragment = fragment,