Skip to content

Commit ed69774

Browse files
Merge pull request #2327 from bcgov/feature/EAC-53
vue route changes for node permissions
2 parents 280db14 + 4dd8b55 commit ed69774

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

frontend/src/components/assessments/reports/AssessmentReports.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ export default {
290290
schoolNameNumberFilter: null,
291291
schoolSearchNames: [],
292292
selectedSessionID: null,
293-
isDistrictUser: false
293+
isDistrictUser: false,
294+
schoolUserSchoolID: null
294295
};
295296
},
296297
computed: {
@@ -303,6 +304,7 @@ export default {
303304
async created() {
304305
authStore().getUserInfo().then(() => {
305306
this.isDistrictUser = this.userInfo.activeInstituteType !== 'SCHOOL';
307+
this.schoolUserSchoolID = this.userInfo.activeInstituteType === 'SCHOOL' ? this.userInfo.activeInstituteIdentifier : null;
306308
});
307309
await this.getAllSessions();
308310
this.setupSchoolLists();
@@ -391,7 +393,8 @@ export default {
391393
async downloadXamFile() {
392394
this.isLoading = true;
393395
try {
394-
const url = `${ApiRoutes.assessments.BASE_REPORTS_URL}/${this.userInfo.activeInstituteType}/${this.selectedSessionID}/school/${this.schoolNameNumberFilter}/download`;
396+
const url = `${ApiRoutes.assessments.BASE_REPORTS_URL}/${this.userInfo.activeInstituteType}/${this.selectedSessionID}/school/${
397+
this.isDistrictUser ? this.schoolNameNumberFilter : this.schoolUserSchoolID}/download`;
395398
window.open(url);
396399
} catch (error) {
397400
console.error(error);

0 commit comments

Comments
 (0)