From 9975cedf9e19e5e8a8c1609be7f1a53dee2059d0 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Fri, 8 Apr 2022 15:23:51 +0200 Subject: [PATCH] MOBILE-3833 workshop: Fix required 'profile' param not found --- src/addons/mod/workshop/pages/assessment/assessment.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/addons/mod/workshop/pages/assessment/assessment.ts b/src/addons/mod/workshop/pages/assessment/assessment.ts index 0c074a4f9..c15c1195f 100644 --- a/src/addons/mod/workshop/pages/assessment/assessment.ts +++ b/src/addons/mod/workshop/pages/assessment/assessment.ts @@ -53,7 +53,7 @@ export class AddonModWorkshopAssessmentPage implements OnInit, OnDestroy, CanLea assessment!: AddonModWorkshopSubmissionAssessmentWithFormData; submission!: AddonModWorkshopSubmissionData; - profile!: CoreUserProfile; + profile?: CoreUserProfile; courseId!: number; access?: AddonModWorkshopGetWorkshopAccessInformationWSResponse; assessmentId!: number; @@ -120,7 +120,7 @@ export class AddonModWorkshopAssessmentPage implements OnInit, OnDestroy, CanLea try { this.assessment = CoreNavigator.getRequiredRouteParam('assessment'); this.submission = CoreNavigator.getRequiredRouteParam('submission'); - this.profile = CoreNavigator.getRequiredRouteParam('profile'); + this.profile = CoreNavigator.getRouteParam('profile'); this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); } catch (error) { CoreDomUtils.showErrorModal(error); @@ -195,7 +195,7 @@ export class AddonModWorkshopAssessmentPage implements OnInit, OnDestroy, CanLea // Get all info of the assessment. const assessment = await AddonModWorkshopHelper.getReviewerAssessmentById(this.workshopId, this.assessmentId, { - userId: this.profile && this.profile.id, + userId: this.profile?.id, cmId: this.workshop.coursemodule, });